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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors