Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to get a total of Agreement Hours but need to filter several requirements. Here is the SQL
sum(case when Time_Entry.Agr_Header_RecID is not null and AGR_Hours = Hours_Bill and Billable_Flag = 'True' and Time_Entry.Company_RecID <> 250 then AGR_Hours else 0 end) AGR_Hours_Total
and here is what I have tried to do in DAX
Solved! Go to Solution.
Hi @gboss87 ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Actual_AGR_Hours_total =
var _if=
FILTER('Time Table',
'Time Table'[Agr_Header_RecID]<>BLANK() &&
'Time Table'[AGR_Hours]='Time Table'[Hours_Bill]&&
'Time Table'[Billable_Flag]="True"&&
'Time Table'[Company_RecID]<>250)
return
SUMX(_if,[AGR_Hours])
2. Result:
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @gboss87 ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Actual_AGR_Hours_total =
var _if=
FILTER('Time Table',
'Time Table'[Agr_Header_RecID]<>BLANK() &&
'Time Table'[AGR_Hours]='Time Table'[Hours_Bill]&&
'Time Table'[Billable_Flag]="True"&&
'Time Table'[Company_RecID]<>250)
return
SUMX(_if,[AGR_Hours])
2. Result:
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Why do you use SWITCH?
Actual_AGR_Hours_total =
CALCULATE(
SUM(
'Time Table'[AGR_Hours],
FILTER(
'Time Table',
NOT(ISBLANK('Time Table'[Agr_Header_RecID])),
'Time Table'[AGR_Hours] = 'Time Table'[Hours_Bill],
'Time Table'[Billable_Flag] = TRUE,
'Time Table'[company_RecID] <> 250
)
)
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |