Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!