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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.