Forum Discussion
Dynamic filtering according to other filter selction
- 10 years ago
I don't think this is the best way to solve this problem. "Time shifting" or time intelligence is a standard feature of Power BI. You need a calendar table that follows "the rules". Read about calendar tables here.
http://exceleratorbi.com.au/power-pivot-calendar-tables/
Once you you have a valid calendar table, you can use functions like PREVIOUSMONTH
https://msdn.microsoft.com/en-us/library/ee634758.aspx
Advantages include
you don't need a column for every different time shift you need
your time shift can compare Feb with Jan and not just current month with previous month as of "today"
- 10 years ago
I agree with MattAllington, we can use some time intelligence functions like DATEADD as below.
LastMonth_Sales =
CALCULATE ( SUM ( Table1[Sales] ), DATEADD ( 'Calendar'[Date], -1, MONTH ) )
I’ve uploaded a .pbix file of simple sample here for reference. Hope it helps.
Best Regards,
Herbert
I agree with MattAllington, we can use some time intelligence functions like DATEADD as below.
LastMonth_Sales =
CALCULATE ( SUM ( Table1[Sales] ), DATEADD ( 'Calendar'[Date], -1, MONTH ) )
I’ve uploaded a .pbix file of simple sample here for reference. Hope it helps.
Best Regards,
Herbert
- udian10 years ago
Helper III
Thanks for your help!