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.
I have a dataset that has a table of records with start and end dates and a period table that has the start and end dates of each period. I have a set of flag measures that creates a dynamic filter to show only active records that fit between a selected start and end date. Now what I need to do is have another option for the user to select N days before the start of the period and show active records based on that. I've been trying to use something like this:
Measure = DATEADD(Calendar[Date], SelectedValue(NDays), DAY)
*NDays would be the value a user would select in a slicer
So far this hasn't worked for me but I'm sure there is a way to do this. Any ideas?
Solved! Go to Solution.
You can have measure like
10 Days behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],10,DAY))
You can use what if measure
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
N Days behind Sales =
var _max =max(Whatif[Whatifmeasure])
return
CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],_max,DAY))
Hi @Al345
If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!
Hi,
See if my solution here helps.
You can have measure like
10 Days behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],10,DAY))
You can use what if measure
https://docs.microsoft.com/en-us/power-bi/desktop-what-if
N Days behind Sales =
var _max =max(Whatif[Whatifmeasure])
return
CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],_max,DAY))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |