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
Ramendra
Helper IV
Helper IV

how to make a filter for last month which work for last year as well for same month in previous year

Hi Team,

I need a filter where I  can select the filter like previous month but it  should work for this year as well as for last year.

 

For  example if  I have data for this year  and last year and I want to show the count of tickets brocken by priority for previous month ( April-2020 and April 2021) then how to create such filter.

 

Can someone please  help me.

1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@Ramendra Hi Ram, in this case i would suggest you to create seperate measure to calculate value for previous year. So when you select April month, it will show the data for both previous year and current year

 

Sales_PY = CALCULATE(SUM('Sales),SAMEPERIODLASTYEAR('Data'[Date].[Date]))



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



Proud to be a Super User!


Follow me on linkedin

View solution in original post

2 REPLIES 2
negi007
Community Champion
Community Champion

@Ramendra Hi Ram, in this case i would suggest you to create seperate measure to calculate value for previous year. So when you select April month, it will show the data for both previous year and current year

 

Sales_PY = CALCULATE(SUM('Sales),SAMEPERIODLASTYEAR('Data'[Date].[Date]))



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



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@Ramendra , Create two measures

 

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

 

last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

 

if you want to switch, you can use measure slicer

measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...

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.