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
Anonymous
Not applicable

Datediff folder using today() and a date on a table

I have created a DAX query provide me with the difference between today() and an expiry date. The expiry date is on a table and differs with each row.

This is my query:- 

DaystoExpiry = DATEDIFF(today(),DISTINCT('transactiondiscount'[Expiry_Date]),day)

 

That formula does not produce an error when I commit the formula. But breaks my table visual when I add it to the visual.

Is there a problem with my formula? Can it be imporoved?

 

Edited:

Ok, so I get this message from the visual

2020-01-27 09_38_50-Window.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

is it meausre or column?

 

if it is column remove distinct else replace distinct with max or selectedvalue.

 

measure DaystoExpiry = DATEDIFF(today(),Selectedvalue('transactiondiscount'[Expiry_Date]),day)

 

Column DaystoExpiry = DATEDIFF(today(),'transactiondiscount'[Expiry_Date],day)

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

is it meausre or column?

 

if it is column remove distinct else replace distinct with max or selectedvalue.

 

measure DaystoExpiry = DATEDIFF(today(),Selectedvalue('transactiondiscount'[Expiry_Date]),day)

 

Column DaystoExpiry = DATEDIFF(today(),'transactiondiscount'[Expiry_Date],day)

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Anonymous
Not applicable

Nice!!

 

I had it as a measure. Made the suggested changes and it worked.

Kudos to you!

 

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.