Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have two visuals on my page and date range (Timeline) selector.
I want the first (1.) to be filtered exactly by the selected range. This already works as expected.
The second on (2.) should be filtered by the last date of the selected range and starting 12 Months earlier.
For example if I select the months Jan and Feb of 2021, the first visual (1.) should show data filtered by 01.01.2021-28.02.2021 and the second visual (2.) from 01.03.2020-28.02.2021.
How can i achieve this behavior?
I already have a CalendarTable generated as following where I could add other fields if needed:
Solved! Go to Solution.
Hi @JonasMarty ,
Since the interaction between the slicer and the visualizations makes your information being filtered by the value on the slicer.
In this case you need to create some minor changes in your model.
In my example I have added a YEARMONTH column to my model but you can add two columns one to year and another of month with the following syntax:
YearMonth = RELATED (CalendarTable[YearMonth])
Add the following measure:
Previous 12 Months =
CALCULATE (
SUM('Table'[Value]),
DATESINPERIOD ('Calendar'[Date], MAX ( 'Calendar'[Date] ), -12, MONTH )
)
Now the setup of your model must be in the following way:
Result below and in attach PBIX file:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @JonasMarty ,
Since the interaction between the slicer and the visualizations makes your information being filtered by the value on the slicer.
In this case you need to create some minor changes in your model.
In my example I have added a YEARMONTH column to my model but you can add two columns one to year and another of month with the following syntax:
YearMonth = RELATED (CalendarTable[YearMonth])
Add the following measure:
Previous 12 Months =
CALCULATE (
SUM('Table'[Value]),
DATESINPERIOD ('Calendar'[Date], MAX ( 'Calendar'[Date] ), -12, MONTH )
)
Now the setup of your model must be in the following way:
Result below and in attach PBIX file:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsUser | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |