I would like to know if there is a way to display dynamically last 12 months data based on Year/Quarter/Month Selection
Tried Many ways but couldnt achieve with Date Hirearchy filter.
If user selects 2021 Q1 ..It should display last 12 months data with axis 2021.01 , 2021.02 , 2021.03 , 2020.12 , 2020.11 , 2020.10 etc
if user selects 2021 March ..It should display march data along with last 12 months data.
Any help would be appreciated 🙂
Solved! Go to Solution.
Hi,
There are multiple ways to do this. One of the more straightforward ways is to make a copy of your calendar table:
Now create measure with following dax:
The visual uses calendar[Date] and slicer calendar_for_visual[date]
Proud to be a Super User!
It was useful for me.
I thought about sharing this tutorial for anyone who would have the same issue but with other visuals where you don't want to activate the relationships between the two calendar tables in every single mesures and keep your dates fields from your main calendar table.
Show last 6 months based on user single slicer selection from SQLBI
Hi @ValtteriN
I followed the same process as you said but the visual displaying whatever month i selected instead of last 12 months, not sure where i missed .
Hi,
Is your relationship M:1 and inactive with filter direction "single" like in my example? Another possible problem might be with the slicer visual. Are you using 'Calendar for visual' table as the slicer? At a glance your DAX seems to follow the same logic so the problem is with visual or relationships.
Proud to be a Super User!
Hi,
There are multiple ways to do this. One of the more straightforward ways is to make a copy of your calendar table:
Now create measure with following dax:
The visual uses calendar[Date] and slicer calendar_for_visual[date]
Proud to be a Super User!
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!