Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I am trying to create a report that can be run at any time, but can be adjusted for historical data based on a date selected by the user.
I have a separate date table joined to the following data on the Target date
Task | Target Date | Status | Duration (in min) |
Task 1 | 1/1/24 | Complete | 25 |
Task 2 | 2/4/24 | Complete | 20 |
Task 3 | 5/1/24 | Complete | 26 |
In the resulting report, we have Last 30 Days, Last 60 Days, and Last 90 Days where we count the completed tasks, average the time to complete, etc. I can write those calculations if the report uses "TODAY()" as the parameter.
=CALCULATE(COUNT([TASK]),[Status]="Complete], [Target Date]>=TODAY()-30
How do I replace "TODAY()-30" with a user selected date without filtering the overall table?
Thank you
Solved! Go to Solution.
Use a "Before" style slicer with the Date from the Date Table, and then remove the slider bar and cover up the grayed-out start date with a non-transparent image the same color as the background, or some other visual etc. I don't know what your report looks like so you'll have to get creative. In any case, the goal is to be left with a single date selector box, as far as the end user is concerned.
But enough about aesthetics, here's the DAX.
Calculation_Last_30_days_from_Selected_Date =
VAR maxdate = MAX(Date_Table[Date])
return
CALCULATE(COUNT([TASK]),[Status]="Complete], Date_Table[Date] >= maxdate - 30)
Difficult to say whether this will work 100% without seeing the structure of your data. But experiment with something like this to see if you can't get it to work.
///Mediocre Power BI Advice, but it's free///
Use a "Before" style slicer with the Date from the Date Table, and then remove the slider bar and cover up the grayed-out start date with a non-transparent image the same color as the background, or some other visual etc. I don't know what your report looks like so you'll have to get creative. In any case, the goal is to be left with a single date selector box, as far as the end user is concerned.
But enough about aesthetics, here's the DAX.
Calculation_Last_30_days_from_Selected_Date =
VAR maxdate = MAX(Date_Table[Date])
return
CALCULATE(COUNT([TASK]),[Status]="Complete], Date_Table[Date] >= maxdate - 30)
Difficult to say whether this will work 100% without seeing the structure of your data. But experiment with something like this to see if you can't get it to work.
///Mediocre Power BI Advice, but it's free///
User | Count |
---|---|
77 | |
77 | |
68 | |
67 | |
49 |
User | Count |
---|---|
108 | |
104 | |
93 | |
83 | |
64 |