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

Last 24 Hours From selected date in slicer

Hello! 

 

I am having an issue, hope someone could help.

 

I am aware of all the various ways of having a measure or a column that gives me the last 24 hours. BUT

If I have a date slicer, and select a date other than today, all the measure won't work since they all calculate the last 24 hours from NOW().

 

How can I have the same outcome but counting from the selected date in the date slicer? 

 

Thank you for you help!

6 REPLIES 6
Anonymous
Not applicable

In your measures replace NOW() with the value that's selected in your slicer.

Anonymous
Not applicable

But how?

It's a date slicer. I am unable to just put the date field instead of NOW()

Hi, @Anonymous 

 

What you need to change is not the slicer, but the measure. According to your description, your measure may use the now() function, change it to selectedvalue(table[date]).

If it doesn't solve your problem, Please share your formula and feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for your replies.

The formula I am using is this one:
Measure = IF(MIN( Date_Table[Date])>=SELECTEDVALUE('Selection Date'[Date]) -1 && MIN(Date_Table[Date])<=SELECTEDVALUE('Selection Date'[Date]),1,0)

 

This just returns "1" everytime

Hi, @Anonymous 

 

Only one measure is not easy to judge the problem, can you share your some sample data and related visuals?

 

Best Regards

Janey Guo

 

Anonymous
Not applicable

What you get from measures in DAX depends on 2 things: 1) how the model is set up and 2) where you use your measure. For the time being we know none of these two things.

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.