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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
navneet0512
Helper III
Helper III

Calcualted column

I am subtrating two date column which is calculated but getting output as summed don't know why . Below is one example of that right one is good as it is 197 it calualyed in M query . left one is calculted in power bi desktop calulated column .

Actual Cycle Time = if(ISBLANK(SS[ActualShipDate]),BLANK(),IF(ISBLANK(SS[OrderReceivedDate]),BLANK(),(DATEDIFF(SS[ActualShipDate],SS[OrderReceivedDate],DAY))))


navneet0512_0-1695753964181.png

 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @navneet0512 
Try this DAX for calculated column :

Actual Cycle Time = if(ISBLANK('Table'[ship date])||ISBLANK('Table'[recieved date]),BLANK(),DATEDIFF('Table'[recieved date],'Table'[ship date],DAY))
Unfortunately, I am out of the limit of pictures that I can attach to the discussions, so I created a file with an example:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Hi @navneet0512  you can replace the order of the parameters of the formula.
Just note that in your example start day is after the end day ...so the result will be (-197)

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @navneet0512 
Try this DAX for calculated column :

Actual Cycle Time = if(ISBLANK('Table'[ship date])||ISBLANK('Table'[recieved date]),BLANK(),DATEDIFF('Table'[recieved date],'Table'[ship date],DAY))
Unfortunately, I am out of the limit of pictures that I can attach to the discussions, so I created a file with an example:
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

want to subtract order recieved date from actual ship date means [actual shipdate - order recieved date]

Hi @navneet0512  you can replace the order of the parameters of the formula.
Just note that in your example start day is after the end day ...so the result will be (-197)

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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