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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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