Flag Column to filter out records

Hi All,

I’m new here and pretty new to Power BI - I’ve been using it since May for work. I’m looking to build a flag column to use as a filter (at least I think this is the easiest solution). Based on the below image, I want to exclude Tom Jones’ hours from the table visual as I only want to show employees who have had union time during the last month and for those employees, I want to display ALL of their hours. To add probably a level of difficulty, I want this flag to work regardless of the fields I bring into the table visual.

I’ve attached a very basic example of the the data I’m working with and an image of what I’m trying to accomplish.

Whether this is a calculated column or a conditional column built in the Query Editor doesn’t matter to me. I just need to exclude people from the table visual who have no union time during the period set in the page filter.

forumsamplepic Example.pbix (269.4 KB)

Thank you!
Michelle

Hi @mvgust,

Welcome to the Forum!

I like straight forward and simple solutions so I added a Visual level Filter
image

Let me know if that is acceptable.
I hope this is helpful.

Hi Melissa! Thanks for the welcome. Unfortunately, this solution doesn’t work for the top table visual in the example I uploaded and that is what I have to include in my table visual for work.

When I set union hours to “is not blank” it reduces the total hours to an incorrect numberexample2

That’s the reason I feel like I need a flag column of some sort.

Hi @mvgust,

I’m sure we can fix that :wink:
Place this measure in your visual and see if that works for you.

Total Hours Value = 
IF( 
    CALCULATE( ISFILTERED( Sheet1[Name] ),
        ALLSELECTED( Sheet1 )
    ),
    CALCULATE( [Total Hours],
        REMOVEFILTERS(Sheet1),
        VALUES( Sheet1[Name] )
    ),
    [Total Hours]
) 

Here’s your sample file. eDNA Example.pbix (270.9 KB)
I hope this is helpful.

1 Like

Hi @mvgust, did the response provided by @user help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark the thread as solved. Thanks!