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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to calculated the difference from the average of all data

I would like to know how to subtract the responding value from the average score in 2021 for all Name

 

sample data:

NameidDateScore
A11/9/20216
B1 1/7/20217
C1 2/8/20218
A21/8/20229
B2 1/6/202210

 

expected outcome:

-2
-1
0
1
2

 

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

Result =
'Table'[Score]
    - CALCULATE (
        AVERAGE ( 'Table'[Score] ),
        ALLEXCEPT ( 'Table', 'Table'[Date].[Year] )
    )

vhenrykmstf_0-1664780195810.png

 

If the problem is still not resolved, please provide a screenshot of the desired result and describe it. Looking forward to your reply.


Best Regards,
Henry


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

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Try formula like below:

Result =
'Table'[Score]
    - CALCULATE (
        AVERAGE ( 'Table'[Score] ),
        ALLEXCEPT ( 'Table', 'Table'[Date].[Year] )
    )

vhenrykmstf_0-1664780195810.png

 

If the problem is still not resolved, please provide a screenshot of the desired result and describe it. Looking forward to your reply.


Best Regards,
Henry


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

MahyarTF
Memorable Member
Memorable Member

Hi,

Create below measure and use it in your visual :

ExpectedVal =
Var _Avg = CALCULATE( AVERAGE(Sheet213[Score]), all(sheet213))
Return CALCULATE(SELECTEDVALUE(Sheet213[Score]) - _Avg)
MahyarTF_0-1664179955062.png

 

Thanks for your Kudos and please mark it as a solution if it helps

Mahyartf
Anonymous
Not applicable

Sorry for confusing what i mean by all data is all name in a specific year, for example, only 2021

Anonymous
Not applicable

How about if i would like to to calculate the lastest difference by calculated measure instead of column? is it possible?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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