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
Dunner2020
Post Prodigy
Post Prodigy

Considering only non-blank measure in if condition

Hi there,

 

I have a measure that compared four measures with numbers and produces the output in the form of "Yes" or "No". The measure looks like as follow:

 

final measure = 

IF([measure1] >= 4 && [measure2]>=10 && [measure3]>=14 && [measure4] >= 14,"Yes","No")
 
Now the issue is that not all 4 measures contain values at the same time. Either 2 or 3 measures have values and the remaining are blank. So I want to consider only those measures in if  condition that has values and ignores those who are blank. Is there any way of doing that in Power BI? 
1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Why not just add 0 to each measure so they are never blank, and they never satisfy their condition.

final measure = 

IF([measure1] +0>= 4 && [measure2]+0>=10 && [measure3]+0>=14 && [measure4] +0>= 14,"Yes","No")
 
Regards,
Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Employee
Employee

Why not just add 0 to each measure so they are never blank, and they never satisfy their condition.

final measure = 

IF([measure1] +0>= 4 && [measure2]+0>=10 && [measure3]+0>=14 && [measure4] +0>= 14,"Yes","No")
 
Regards,
Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Dunner2020
Post Prodigy
Post Prodigy

@NamishB , I already tried that and it did not work. Moreover, I want to setup blank measure in such away that if measure is blank then it should not be the part of if condition.

NamishB
Post Prodigy
Post Prodigy

Hi @Dunner2020 - Can you try measure like below:

final measure = 

IF(NOT ISBLANK([measure1]) >= 4 && NOT ISBLANK([measure2])>=10 && NOT ISBLANK([measure3])>=14 && NOT ISBLANK([measure4]) >= 14,"Yes","No")

 

Thanks,

-Namish B

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.