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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.