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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Dax Measure with conditions

I have the following data

IHR 1.PNG

I need to show the output as follows:

IHR 2.PNG

the logic is - count of those ID's whose status IS NOT "Closed/Completed" and "Closed/Cancelled". 

I tried creating a measure as follows:

calculate(count(Table[ID]), status = "Assigned", staus = "New", status = "Pending Change", Status = "submit for approval"), but it just threw a blank, so I'm not sure where I am going wrong.

 

How can this be done? Thank you!

 

1 ACCEPTED SOLUTION
judspud
Solution Supplier
Solution Supplier

Hi @Anonymous 

 

What your current measure is doing is counting all the rows where each of those statements is true however the status cannot be all of them which is why you are getting a blank.

 

Try replacing the commas with ||

 

calculate(count(Table[ID]), status = "Assigned" || status = "New" || status = "Pending Change" || Status = "submit for approval")

 

This is used instead of the OR function as the OR function only allows for 2 conditions. Alternatively, you could nest OR statements however the 2 pipe symbols is an easier approach for more than 2 or conditions.

 

Hope this helps

 

Thanks,

George

View solution in original post

1 REPLY 1
judspud
Solution Supplier
Solution Supplier

Hi @Anonymous 

 

What your current measure is doing is counting all the rows where each of those statements is true however the status cannot be all of them which is why you are getting a blank.

 

Try replacing the commas with ||

 

calculate(count(Table[ID]), status = "Assigned" || status = "New" || status = "Pending Change" || Status = "submit for approval")

 

This is used instead of the OR function as the OR function only allows for 2 conditions. Alternatively, you could nest OR statements however the 2 pipe symbols is an easier approach for more than 2 or conditions.

 

Hope this helps

 

Thanks,

George

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.