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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
moeconsult
Helper V
Helper V

IF difference between startdate and updated date >

I have the excel formula working but I need help with the dax version of it,

 

=IF(F2="",A2,IF(AND((D2-F2)>2,E2="Cancelled"),0,A2))

 

Sample Data below:

    A           B                          C                      D                         E                   F                                  G

feeDateEnddateStartdateStatusUpdatedExpectedOutput
£1017/09/2020 16:0015/09/2020 00:0015/09/2020Attended06/04/2020£10.00
£1017/09/2020 16:0016/09/2020 18:0016/09/2020Cancelled06/04/2020£0.00
£1017/09/2020 16:0029/06/2020 18:0029/06/2020Cancelled28/06/2020£10.00
£1017/09/2020 16:0017/09/2020 16:0017/09/2020Pending £10.00
£1017/09/2020 16:0030/06/2020 16:0030/06/2020Pending £10.00
£1017/09/2020 16:0015/09/2020 00:0015/09/2020Pending £10.00
£1017/09/2020 16:0016/09/2020 18:0016/09/2020Pending £10.00
£1017/09/2020 16:0029/06/2020 18:0029/06/2020Pending £10.00
£1017/09/2020 16:0017/09/2020 16:0017/09/2020Pending £10.00
£1017/09/2020 16:0030/06/2020 16:0030/06/2020Pending £10.00
£1017/09/2020 16:0015/09/2020 00:0015/09/2020Pending £10.00
£1017/09/2020 16:0016/09/2020 18:0016/09/2020Pending £10.00
£1017/09/2020 16:0029/06/2020 18:0029/06/2020Pending £10.00
£1017/09/2020 16:0017/09/2020 16:0017/09/2020Pending £10.00
£1017/09/2020 16:0030/06/2020 16:0030/06/2020Pending £10.00
£1017/09/2020 16:0015/09/2020 00:0015/09/2020Pending £10.00
£1017/09/2020 16:0016/09/2020 18:0016/09/2020Pending £10.00
£1017/09/2020 16:0029/06/2020 18:0029/06/2020Pending £10.00
£1017/09/2020 16:0017/09/2020 16:0017/09/2020Pending £10.00
£1017/09/2020 16:0030/06/2020 16:0030/06/2020Pending £10.00
       
       
       
       
       
       
2 ACCEPTED SOLUTIONS
az38
Community Champion
Community Champion

Hi @moeconsult 

try

Column = 
IF(ISBLANK([Updated]), [fee],
 IF([Status]="Cancelled" && ([Startdate] - [Updated]) > 2, 0, [fee])
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

camargos88
Community Champion
Community Champion

Hi @moeconsult ,

 

Try this custom column:

 

C = IF('Table (2)'[Update] = BLANK(); 'Table (2)'[fee]; IF('Table (2)'[Start Date] - 'Table (2)'[Update] > 2 && 'Table (2)'[Status] = "Cancelled"; 0; 'Table (2)'[fee]))
 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
camargos88
Community Champion
Community Champion

Hi @moeconsult ,

 

Try this custom column:

 

C = IF('Table (2)'[Update] = BLANK(); 'Table (2)'[fee]; IF('Table (2)'[Start Date] - 'Table (2)'[Update] > 2 && 'Table (2)'[Status] = "Cancelled"; 0; 'Table (2)'[fee]))
 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



az38
Community Champion
Community Champion

Hi @moeconsult 

try

Column = 
IF(ISBLANK([Updated]), [fee],
 IF([Status]="Cancelled" && ([Startdate] - [Updated]) > 2, 0, [fee])
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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