Forum Discussion
Anonymous
1 year agoNot applicable
Dynamic Slicer to Filter Data
HI There, I am trying to create a slicer/filter and chart like in excel in which. I am having a datecolumn with TimeStamp and i want a view like below : Expected Result : TimePeriod ...
TomasAndersson
Solution Sage
1 year agoHi!
Sounds like you want to create a calculation group. You can read more about it here: Create calculation groups in Power BI - Power BI | Microsoft Learn
But basically you find calculation groups in the model view and create a new
And then you create a number of calculation items that you later can use to dynamically slice a measure in different ways, such as
Yesterday =
CALCULATE(
SELECTEDMEASURE(),
Dates[Date] = TODAY()
)
Today =
CALCULATE(
SELECTEDMEASURE(),
Dates[Date] = TODAY() - 1
)
YTD =
CALCULATE(
SELECTEDMEASURE(),
DATESYTD(Dates[Date])
)and so on
Then you can just add the calculation group as a slicer and let it dynamically slice any measure you have. Try it out and let me know if you need any more help. Good luck!