Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Filter Multiple Columns from single table

I have a table RT Hr DB an it has multiple columns. Want to filter column Department=UW and Hour Type=Overtime and sum the Days. This is what I have so far

 

SUMX(FILTER(FILTER('RT Hr DB','RT Hr DB'[Hour Type]="Vacation"), RT Hr DB'[Department]="Underwriting"), 'RT Hr DB[Days])
6 REPLIES 6
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Give this a try.

UW OT = 
CALCULATE(
    SUM ( 'RT Hr DB'[Days] ),
    'RT Hr DB'[Department] = "Underwriting",
    'RT Hr DB'[Hour Type] = "Overtime")
Anonymous
Not applicable

@jdbuchanan71 

 

I tried this but it still does not give me the right answer.

Hello @Anonymous 

Please provide some sample data and and example of the expected outcome.

Anonymous
Not applicable

Formula 1 = (SUMX(filter('RT Prod HC',[Team]="UW"),[Workdays])-(CALCULATE(SUM('RT Hr DB'[Days]),'RT Hr DB'[Hour Type] = "Vacation",'RT Hr DB'[Department] = "Underwriting"))-CALCULATE(SUM('RT Hr DB'[Days]),'RT Hr DB'[Hour Type] = "Partial Hours Off",'RT Hr DB'[Department] = "Underwriting")+(CALCULATE(SUM('RT Hr DB'[Days]),'RT Hr DB'[Hour Type] = "Overtime",'RT Hr DB'[Department] = "Underwriting"))/(SUMX(FILTER('RT Prod HC',[Team]="UW"),'RT Prod HC'[Prod HC])))
 
Formula 2 = 
(SUMX(filter('RT Prod HC',[Team]="UW"),[Workdays])-((SUM('UW Vacation'[Days]))/(SUMX(FILTER('RT Prod HC',[Team]="UW"),'RT Prod HC'[Prod HC])))+((SUM('UW Overtime1'[Days]))/(SUMX(FILTER('RT Prod HC',[Team]="UW"),'RT Prod HC'[Prod HC]))))
 
Formula 1 is when I tried to filter the same table multiple times. Formula 2 is when I duplicate the table in power query and then put in the filters. Both have the same data but they are giving me 2 different answers.
image.png

@Anonymous 

In your picture, what number is wrong and what should it be?  Also, we will need sample data from the tables involved and to know how the model relationships are set up.  If you can share your .pbix file that will help us answer your question.

Anonymous
Not applicable

@jdbuchanan71 image.png

This table is where the raw data is taken from. I duplicated this table to filter out without a formula. The line graph with value 8.95 should be the right one which i got by duplicating the table and filtering it separately rather than doing multiple filters with the formula.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.