Reply
pmstahl
Frequent Visitor
Partially syndicated - Outbound

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
v-nuoc-msft
Community Support
Community Support

Syndicated - Outbound

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

Syndicated - Outbound

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-nuoc-msft
Community Support
Community Support

Syndicated - Outbound

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.

 

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)