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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
stoppm
Frequent Visitor

Create a measure to dynamically subtract difference between today's date and date in table

Hi, I have a slicer on a page that allows a user to select the timeframe they want to see data for (month, week, day). If I have a value with a timestamp of today's date, I want my visual to show today's value when the user selects any of the options.

 

Currently, the value with today's date is just categorized as "day", because I can't figure out how to dynamically filter and get today's date to show for all 3 three timeframes.

 

Is there a measure I can write that could handle this? 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

If the timeframe key is from date table , you can try this.

 

Measure = DATEDIFF(max('Date'[Date]),today(),day)
 
11.png




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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
danextian
Super User
Super User

Hi @stoppm 

 

Just basing on the description, @ryan_mayu 's solution should work. Otherwise, please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @stoppm ,


If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Hi @stoppm ,

We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.

If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!

Thank you!

 

Hi @stoppm ,

If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

ryan_mayu
Super User
Super User

If the timeframe key is from date table , you can try this.

 

Measure = DATEDIFF(max('Date'[Date]),today(),day)
 
11.png




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

Proud to be a Super User!




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors