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
Albertvw
Frequent Visitor

Latest 3 month Index average

If I run an Access ave of latest 3 monht ave index score, I get 82.65, which is correct if I test manually.

 

If I use measurement for sample: =CALCULATE(COUNT(TABLE[INDEX]), DATESINPERIOD(TABLE[MONTH], MAX(TABLE[MONTH], -3, MONTH)) I get the correct sample count for the latest 3 months index sample.

 

However, then using:  =CALCULATE(AVERAGE(TABLE[INDEX], DATESINPERIOD(TABLE[MONTH], MAX(TABLE[MONTH], -3, MONTH)) I get 82.78

 

Why the 'incorrect' ave calculation?

 

Thank you

 

 

1 REPLY 1
v-sihou-msft
Employee
Employee

Hi @Albertvw,

 

In DAX, when a column contains blank values, those rows will not be counted in AVERAGE() function. I think this is the reason why you get a little greater result when using AVERAGE() funciton. Please see: AVERAGE Function (DAX). To avoid this issue, you can use SUM divide by COUNTROWS to get correct result.

 

Regards,

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.