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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.