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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Last Quarter Calculation

I have this data:

1.PNG

 

I was attempting to get the average of the first quarter, however it is only returning the last month of the first quarter. Doing the math by hand, the number should be returning -9.42 if I'm averaging -5.88,-9.86 and -17.39. How can I appropriately calculate this? The Month End column is column is coming from a date table.

1 REPLY 1
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

In your scenario, the [TTM Average] is a measure. As I don’t know the raw data and logic of this measure, I treat the measure as a column in my test. Also the average of -5.88, -9.86, -17.39 should be (-5.88-9.86-17.39)/3=-11.04. Not sure why you would like to return it as -9.42.


Based on my test, you can create a measure to calculate the average of the first quarter below, and use your own measure "TTM average" to replace the "SUM(sheet 1[TTM average])" in my function on your side. You can also download the PBIX file to have a view.

 

First quarter average = DIVIDE(CALCULATE(SUM(Sheet1[TTM average]),FILTER(Sheet1,Sheet1[Quarter]="Qtr 1")),COUNTROWS(FILTER(Sheet1,Sheet1[Quarter]="Qtr 1")))

 

q5.jpg

 

If above measure doesn’t meet your requirement. Please share some sample data for us to test it. It would be better if you could share the pbix file.

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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