Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi guys,
I need to calculated yesterday's data based on date slicer vs any day in the past based on user's selection
Yesterday will be always given from the date slicer, for example if the user put 11/11/2020 (the value will be from 10/11/2020)
I have worked out the yesterday's calculation which is:
Solved! Go to Solution.
@Anonymous
You can use selectedvalue() and -1, to get the day before the selected date.
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
@Anonymous
You can use selectedvalue() and -1, to get the day before the selected date.
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
You could alter your measure for yesterday's sales so that a slicer isn't needed, then create a new measure which pulls back sales from the selected date in a slicer.
For yesterday's sales you could use this logic:
Sales Yesterday = CALCULATE(SUM([Sales]),Date=TODAY()-1)
You could then use logic similar to the below to pull back the date selected in your slicer:
Date Selected Sales =
CALCULATE(SUM([Sales]),FILTER(ALLSELECTED([Date].[Date]),Date.Date<=MAX(Date.Date)))
Hi,
the problem that i can see in this solution is that my yesterday's measure must be dinamic regarding to the date filter as well
If the user select 10/11 the it should be 09/11 and so on.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.