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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
byWing
Frequent Visitor

DAX for checking 2 dates

Hi All,

 

I find myself struggling with DAX and appreciate some insights on how to write this DAX pls:

 

End goal: To set up conditional formatting which will flag an item if the [Due Date] is pass today, AND the [Corrective Action Completion Date] is blank, (which means the engineer has not completed the work yet.)

 

byWing_0-1695799619765.png

byWing_1-1695799674496.png


My error: 

byWing_0-1695801423124.png

 

Something must be wrong with [Corrective Action Completion Date], but I cannot figure out why.

 

Any insights, advice will be much appreciated pls.

Thank you so much~

1 ACCEPTED SOLUTION
Sergii24
Resolver III
Resolver III

Hi @byWing, the answer is right there in your error message: ISBLANK() requires you to pass a single value as an argument, not a table. You can use SELECTEDVALUE() or any other aggregation to obtain a single value. This should work fine:

Overdue = 
   if(
      AND(
         MAX( [Due Date] )>TODAY(),
         ISBLANK( SELECTEDVALUE( sa_RPN_Reduction[corrective action completion date] ) )
      ),
      1,
      0
   )

View solution in original post

2 REPLIES 2
Sergii24
Resolver III
Resolver III

Hi @byWing, the answer is right there in your error message: ISBLANK() requires you to pass a single value as an argument, not a table. You can use SELECTEDVALUE() or any other aggregation to obtain a single value. This should work fine:

Overdue = 
   if(
      AND(
         MAX( [Due Date] )>TODAY(),
         ISBLANK( SELECTEDVALUE( sa_RPN_Reduction[corrective action completion date] ) )
      ),
      1,
      0
   )

Thank you @Sergii24  for your reply. Your reply helped me a lot and this is the final one I used:

 

Overdue =
   if(
      AND(
         MAX(SA_RPN_Reduction[Due Date])<TODAY(),
         ISBLANK( SELECTEDVALUE(SA_RPN_Reduction[Corrective Action Completion Date] ) )
      ),
      1,
      0
   )
 
Yay!

byWing_0-1695804353382.png

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.