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.
Hi,
Pretty new to Power BI and ran into the following challenge:
I have a linechart visual which I want to adjust according the user selection in a slicer (months). So if the user selects July I want to only show the values $Actual for the month July and the previous 5 months (June, May, Apr, Mar, Feb). Ofcourse I managed to do this hardcoded $ActualHardcoded, also see table, however the challenge is to get this in a dynamic form.
$ActualHardcoded =
CALCULATE(sum('Act/Bud/Est'[Value]);
FILTER('Act/Bud/Est';'Act/Bud/Est'[Scenario]="actual");
FILTER('date';'date'[MonthIndex]>493); //493 is monthindex Jan
FILTER('date';'date'[MonthIndex]<=499)) //499 is monthindex Jul (selection)
Img:
1 is current data (not linked to slicer Month)
2 is preferred end result
Thanks in advance!
(I did notice other people had similar issues in other topic however I did not manage to apply those to my solution 😞 ).
Jurre
Solved! Go to Solution.
Hi @JurreVanGool,
Here is a sample which shows how to display previous X days in visual based on slicer selection, the logic is similar to your scenario:
Rolling N Dates based on slicer selection
By the way, you'd better set the X-axis type to 'Categorical'.
Best regards,
Yuliana Gu
Hi @JurreVanGool,
Here is a sample which shows how to display previous X days in visual based on slicer selection, the logic is similar to your scenario:
Rolling N Dates based on slicer selection
By the way, you'd better set the X-axis type to 'Categorical'.
Best regards,
Yuliana Gu
Hey,
to solve this you need an unrelated table, this table then is used for the selection used on the xaxis.
Then you have to adjust your measures to map the table on the unrelated table. Here you will find a pbix file Have a look at the page "Date axis unrelated".
Hope this helps
Regards
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 |
---|---|
108 | |
98 | |
78 | |
65 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |