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

Adding condition/criteria to remove blank datasets

Hello Power BI Community,

 

I have a situation where the data I have feeding to tables and multiple Donut Charts is being skewed based on blank data. This is causing a real headache because I am not sure how to fix. Currently, the data is being run by a measure such as the following: 

 

OTD Label = IF(OnTimeDelivery[DayDiff2] <= -5 , "Early", IF(AND(OnTimeDelivery[DayDiff2] >= -4, OnTimeDelivery[DayDiff2] <= 3), "On-Time", IF(OnTimeDelivery[DayDiff2] >= 4, "Late", "NV")))
 
What this is doing, as can be seen by the picture below, is causing even blank values to come up and counted as "On-Time" which is causing the data to become inaccurate. Is there a way to add a function to my current measure that does not count blank data? Thank you for all your help community. I will submit a picture below showing the problem. 
 

BlankBIsnip.png

 

 
 
 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

check out the "Diabolical Genius of SWITCH TRUE"

https://powerpivotpro.com/2015/03/the-diabolical-genius-of-switch-true/

 

OTD Label = 
SWITCH(
       TRUE(),
       ISBLANK(OnTimeDelivery[DayDiff2]), BLANK(),
       OnTimeDelivery[DayDiff2] <= -5   , "Early",
       OnTimeDelivery[DayDiff2] <=  3   , "On-Time",
       OnTimeDelivery[DayDiff2] >=  4   , "Late",
       "NV"
       )

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

2 REPLIES 2

Hi @Anonymous ,

 

check out the "Diabolical Genius of SWITCH TRUE"

https://powerpivotpro.com/2015/03/the-diabolical-genius-of-switch-true/

 

OTD Label = 
SWITCH(
       TRUE(),
       ISBLANK(OnTimeDelivery[DayDiff2]), BLANK(),
       OnTimeDelivery[DayDiff2] <= -5   , "Early",
       OnTimeDelivery[DayDiff2] <=  3   , "On-Time",
       OnTimeDelivery[DayDiff2] >=  4   , "Late",
       "NV"
       )

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


amitchandak
Super User
Super User

@Anonymous , Try like


if(isblank(DayDiff2),blank(),IF(OnTimeDelivery[DayDiff2] <= -5 , "Early", IF(AND(OnTimeDelivery[DayDiff2] >= -4, OnTimeDelivery[DayDiff2] <= 3), "On-Time", IF(OnTimeDelivery[DayDiff2] >= 4, "Late", "NV"))))

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.