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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RahulPBI
Helper I
Helper I

Calculated Column With If Then Show Null

Hi Experts

I have a calculated column that calculates the number of days between two dates and excludes any holidays. Managed to do that with help from members on this forumn. Its been working perfectly till I found another requirement where I need to add an IF clause to it

Below is the formula that works

 

1 Late = CALCULATE(SUM('Date Dimention'[IsWorkday]),
2 DATESBETWEEN('Date Dimention'[FullDateAlternateKey],
3 RF_DIFOT_Report[Promised Ship Date v1],
4 RF_DIFOT_Report[Actual Ship Date]-1))
 
I have another conditional column where I have calculated if the row is "On Time" or "Late" depending on certain criteria. Table and Coulmn Name is RF_DIFOT_Report[DIFOT vs Promise]
 
What I need to do is add a criteria to the current formula that if RF_DIFOT_Report[DIFOT vs Promise] = "On Time" then the the result in the Calculated Column Late must show as blank
 
See below
Capture.JPG
Thanks
 
Regards
RPBI
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

So, like this?

 

Late = 
  IF(
    [DiFOT vs Promise] = "On Time",
    BLANK(),
    CALCULATE(
      SUM('Date Dimention'[IsWorkday]),
      DATESBETWEEN(
        'Date Dimention'[FullDateAlternateKey],
        RF_DIFOT_Report[Promised Ship Date v1], 
        RF_DIFOT_Report[Actual Ship Date]-1
      )
    )
  )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

So, like this?

 

Late = 
  IF(
    [DiFOT vs Promise] = "On Time",
    BLANK(),
    CALCULATE(
      SUM('Date Dimention'[IsWorkday]),
      DATESBETWEEN(
        'Date Dimention'[FullDateAlternateKey],
        RF_DIFOT_Report[Promised Ship Date v1], 
        RF_DIFOT_Report[Actual Ship Date]-1
      )
    )
  )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg

Worked like a charm

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.