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.
Hello,
I'm looking for someone to please correct my DAX formula below. It does not work. I think it reads fairly straightforward, however I'm obviously missing something.
I'm aware Power Query could handle this much easier, but I'm using DirectQuery and need to build it in a measure.
Any help is greatly appreciated.
Overdue Inspection Recommendations =
CALCULATE (
COUNT ( 'Inspection Recommendations'[Recommendation_ID] ),
MAX ( [Target_Completion_Date] ),
'Inspection Recommendations'[Target_Completion_Date] < NOW ()
&& 'Inspection Recommendations'[Status] <> "CANCELLED"
&& 'Inspection Recommendations'[Status] <> "IMPLEMENTED"
&& 'Inspection Recommendations'[Status] = "APPROVED"
&& ( 'Inspection Recommendations'[Risk_Rank] = "Red"
|| 'Inspection Recommendations'[Risk_Rank] = "Orange"
|| 'Inspection Recommendations'[Risk_Rank] = "Yellow" )
) + 0
Solved! Go to Solution.
Hi @patri0t82 ,
The second parameter of CALCULATE is a filter, which can be a Boolean (true/false) expression or a table expression defining the filter.
Please try like:
Overdue Inspection Recommendations =
CALCULATE (
COUNT ( 'Inspection Recommendations'[Recommendation_ID] ),
TableName[ColumnName] = MAX ( [Target_Completion_Date] ),
'Inspection Recommendations'[Target_Completion_Date] < NOW ()
&& 'Inspection Recommendations'[Status] <> "CANCELLED"
&& 'Inspection Recommendations'[Status] <> "IMPLEMENTED"
&& 'Inspection Recommendations'[Status] = "APPROVED"
&& ( 'Inspection Recommendations'[Risk_Rank] = "Red"
|| 'Inspection Recommendations'[Risk_Rank] = "Orange"
|| 'Inspection Recommendations'[Risk_Rank] = "Yellow" )
) + 0
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @patri0t82 ,
The second parameter of CALCULATE is a filter, which can be a Boolean (true/false) expression or a table expression defining the filter.
Please try like:
Overdue Inspection Recommendations =
CALCULATE (
COUNT ( 'Inspection Recommendations'[Recommendation_ID] ),
TableName[ColumnName] = MAX ( [Target_Completion_Date] ),
'Inspection Recommendations'[Target_Completion_Date] < NOW ()
&& 'Inspection Recommendations'[Status] <> "CANCELLED"
&& 'Inspection Recommendations'[Status] <> "IMPLEMENTED"
&& 'Inspection Recommendations'[Status] = "APPROVED"
&& ( 'Inspection Recommendations'[Risk_Rank] = "Red"
|| 'Inspection Recommendations'[Risk_Rank] = "Orange"
|| 'Inspection Recommendations'[Risk_Rank] = "Yellow" )
) + 0
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
That makes perfect sense. Thanks for clearing it up for me!
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |