Reply
avatar user
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.
avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

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