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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
cottrera
Post Prodigy
Post Prodigy

DAX is Percentage < OR > than total Average

Hi 

 

I have a facts table with property reference, Address, K.P.I  measures , scores. Each property has multiple K.P.I measures so the properties is repeated multiple times.

Property ReferenceAddressMeasureScore
1AK.P.I-150
1AK.P.I-2100
1AK.P.I-375
2BK.P.I-175
2BK.P.I-210
2BK.P.I-30
3CK.P.I-10
3CK.P.I-2100
3CK.P.I-3100
4DK.P.I-1100
4DK.P.I-2250
4DK.P.I-3100

I would like a DAX function that SUMS the scores by property

 

Property ReferenceAddressSum of Score1234

A225
B85
C200
D450

 

I then need to know the total AVERAGE of the above aggregation 

 

Avg Score
240

 

The finaly part of the DAX function would be, to show a if the aggregated Score is Greater > or Lower< than the total average score.

 

Property ReferenceAddressSum of ScoreAvg ScoreDifference% < or > Average
1A225240-15-6.25%
2B85240-155-64.58%
3C200240-40-16.67%
4D45024021087.50%

 

Hope this makes sense

 

thank you

Richard

1 ACCEPTED SOLUTION
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @cottrera ,

You will be required to make the below 4 measures to get the required results :

1) ReferenceAddress Sum of score = CALCULATE(SUM('Table'[Score]),ALLEXCEPT('Table','Table'[Address]))

2) Avg Score = calculate(AVERAGEX('Table',[ReferenceAddress Sum of score]),ALL('Table'[Address]))
3) 
Difference = [ReferenceAddress Sum of score] - 'Table'[Avg Score]
4) % vs Avg score = ([Difference]/'Table'[Avg Score])*100

And we will get the below results -
Image.JPG
 
Please Accept the solution if it answers you query.
Thanks,
Avantika

View solution in original post

2 REPLIES 2
cottrera
Post Prodigy
Post Prodigy

Thank you for your quick response

Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @cottrera ,

You will be required to make the below 4 measures to get the required results :

1) ReferenceAddress Sum of score = CALCULATE(SUM('Table'[Score]),ALLEXCEPT('Table','Table'[Address]))

2) Avg Score = calculate(AVERAGEX('Table',[ReferenceAddress Sum of score]),ALL('Table'[Address]))
3) 
Difference = [ReferenceAddress Sum of score] - 'Table'[Avg Score]
4) % vs Avg score = ([Difference]/'Table'[Avg Score])*100

And we will get the below results -
Image.JPG
 
Please Accept the solution if it answers you query.
Thanks,
Avantika

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.