Forum Discussion
Display Data for Last 3 months based on slicer selection
- 6 years ago
Anonymous you have to use disconnected table for this purpose, create a table for slicer and use value from that table to filter the data in your main table using TREATAS
Measure = VAR __dateRange = DATESINPERIOD ( DateDisconnected[Date], MAX( DateDisconnected[Date] ), -3, MONTH ) RETURN CALCULATE ( SUM ( Table[Amount] ), TREATAS ( __dateRange, DateTable[Date] ) )I haven't tested this but it will get you started if you are unable to figure out, share sample pbix file and can take a look.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Anonymous you have to use disconnected table for this purpose, create a table for slicer and use value from that table to filter the data in your main table using TREATAS
Measure =
VAR __dateRange = DATESINPERIOD ( DateDisconnected[Date], MAX( DateDisconnected[Date] ), -3, MONTH )
RETURN
CALCULATE ( SUM ( Table[Amount] ), TREATAS ( __dateRange, DateTable[Date] ) )
I haven't tested this but it will get you started if you are unable to figure out, share sample pbix file and can take a look.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Hi parry2k It worked for me with disconnected calendar. However I have an additional requiremnet- I need to display last 2 alternative months data. [ my need is date in slicer and date in matrix are cominf from same table - ]
when I select mar, then matrix should display data of jan, mar.
If I select apr, then display data of feb, april
If I select aug in slicer, matrix should display data of jun, aug.
Re: display data for last 2 alternative months whe... - Microsoft Power BI Community
The Dax worked for disconnected calendar.