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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pmstahl
Frequent Visitor

Trailing 12 Month YoY % Comparison

Goal: Show a percentage by month that compares the rolling 12 month sum to the prior year's 12 month sum. 

2024-07-25_12-21-47.jpg

Examples:
For 2024-06, the current 12 month sum is 3195. The previous year's 12 month sum is 1800. 
3195 / 1800 - 1 = 78% growth

 

For 2024-05, the 12 month sum 3125. The previous year's 12 month sum is 1483.

3125 / 1483 - 1 = 88% growth

 

Then plot the % growth across time being the x-axis:

2024-07-25_12-24-45.jpg

 

CHALLENGE/ISSUE: Based on my available data in PowerBI, I want to show the graph from 2023-05 to 2024-06 but when I filter out the year-month I don't want on the visual, I lose the data from those months and the 12 month sums get messed up in the filter context. 

 

2024-07-25_12-27-33.jpg

 

I have watched some videos that duplicate the date table to use a slicer context and then incorporate the slicer dates filter context in the calculate function but nothing I have tried can produce the results I am looking for. 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pmstahl 

 

According to your description, the result is incorrect due to data loss after using the filter. This may have something to do with the filter criteria you used when creating measure.

 

To ensure that the calculation is not affected by the slicer, use or ignore the slicer context in the measure. For example,

 

All: Ignore all filters.

 

Measure = CALCULATE(SUM('Table'[values]), ALL('Table'))

 

vnuocmsft_0-1721960853854.png

 

 

If you still have problems, it is best to provide the pbix file and be careful to delete sensitive data.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @pmstahl 

 

According to your description, the result is incorrect due to data loss after using the filter. This may have something to do with the filter criteria you used when creating measure.

 

To ensure that the calculation is not affected by the slicer, use or ignore the slicer context in the measure. For example,

 

All: Ignore all filters.

 

Measure = CALCULATE(SUM('Table'[values]), ALL('Table'))

 

vnuocmsft_0-1721960853854.png

 

 

If you still have problems, it is best to provide the pbix file and be careful to delete sensitive data.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors