Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
smogie
Frequent Visitor

Slicer that selects previous months automatically

Hi all,

 

I have multiple pages that require month-slicers that automatically select the previous months. So when I select March, then January en February should be selected automatically as well. Can anyone help me how to do this?

 

Gr. Steven

1 ACCEPTED SOLUTION

Hi @smogie ,

 

I believe you need to have a disconected date table.

 

Check this file: Download PBIX 

 

Also it's possible to create a what-if parameter, so you can select the number of months dynamically.

 

If you consider it as a solution, please mark as a solution and kudos.

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

4 REPLIES 4
camargos88
Community Champion
Community Champion

Hi @smogie ,

 

Do you need to show the previous months name or just add the values from them ?

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi @camargos88 ,

 

The whole page must add the values and/or show months separately. For example the graph shows only January but when I click on the slicer on the month June, then the graph shows January - June (so all the data for each month) in a different column or row.

 

Steven

Hi @smogie ,

 

I believe you need to have a disconected date table.

 

Check this file: Download PBIX 

 

Also it's possible to create a what-if parameter, so you can select the number of months dynamically.

 

If you consider it as a solution, please mark as a solution and kudos.

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Nor clear after the second update. But these can help

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))

 

Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-6,MONTH))

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.