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
drgrd13
Helper I
Helper I

datediff column -Power bi

Hi
I want to create the same formula in power bi from Excel. But not too sure how to achieve this. the main formula used in Excel in column to DUE is =IF([@PromiseDt]=0,"Uncommitted",[@PromiseDt]-MAX(TODAY(),[@DueDate]))

DueDate               PromiseDt         to Due
27-Jan-22                   Uncommitted
01-Feb-22 22-Apr-2022-5
17-Apr-22 06-May-20229
08-Aug-2208-Aug-220
12-Oct-2227-Apr-2022-168
17-Apr-228-May-202221
07-Jun-2212-Jul-202235
12-Jul-2212-Jul-220
   



 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @drgrd13 

you may Create a new Column 

 

 

To Due =
IF (
    ISBLANK ( Table[PromiseDt] ),
    "Uncommitted",
    DATEDIFF ( Table[PromiseDt], MAX ( TODAY (), Table[DueDate] ), DAY )
)

 

 

View solution in original post

3 REPLIES 3
drgrd13
Helper I
Helper I

Thank you for the help but the formula is resulting in an error msg as below

drgrd13_0-1651091103633.png

 

@drgrd13 

Yes this is not allowed. You can retun blank 

To Due = IF ( NOT ISBLANK ( Table[PromiseDt] ),  DATEDIFF ( Table[PromiseDt], MAX ( TODAY (), Table[DueDate] ), DAY ) )

 

Or otherwise, you can return the date as string. 

 

 

tamerj1
Super User
Super User

Hi @drgrd13 

you may Create a new Column 

 

 

To Due =
IF (
    ISBLANK ( Table[PromiseDt] ),
    "Uncommitted",
    DATEDIFF ( Table[PromiseDt], MAX ( TODAY (), Table[DueDate] ), DAY )
)

 

 

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 community update carousel

Fabric Community Update - June 2025

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