Forum Discussion
Two charts based on different date range with a single slicer
Hello, I have a request to show two column charts with a date slicer. The date slicer would select the date range for the top chart and I need a way to filter the second chart for the month previous to what is selected in the slicer. The screen show shows the page but with two slicers.
Is there a way to filter the bottom based on calculated dates from the date slicer?
I will post a link to a pbix file once I get off-site.
Hi Anonymous
If I understand you correctly you don't need a bottom slicer.If this model is without a date table
You can just use 2 Dax measures above :
1. Basic:
for example
sum profits = sum('financials'[ Sales])2. For previous month :
The best practice is to use a date table, it will help for all measures with time intelligence.
please refer to the linked tutorials
https://www.youtube.com/watch?v=-gEhRzdhKro
https://blog.enterprisedna.co/power-bi-calendar-table/
https://www.datacamp.com/tutorial/how-to-create-date-tables-in-power-bi-tutorial
My example is linked Here
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
3 Replies
- Ritaf1983
Super User
Hi Anonymous
If I understand you correctly you don't need a bottom slicer.If this model is without a date table
You can just use 2 Dax measures above :
1. Basic:
for example
sum profits = sum('financials'[ Sales])2. For previous month :
The best practice is to use a date table, it will help for all measures with time intelligence.
please refer to the linked tutorials
https://www.youtube.com/watch?v=-gEhRzdhKro
https://blog.enterprisedna.co/power-bi-calendar-table/
https://www.datacamp.com/tutorial/how-to-create-date-tables-in-power-bi-tutorial
My example is linked Here
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- AnonymousNot applicable
Ritaf1983In our production environment we do have a date table. I put the sample together on the fly more as a visual tool than a model. Per your response, we would use the previousmonth command with the date table also, correct?
- Ritaf1983
Super User
Hi Anonymous
yep 🙂If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly