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.
Hi Everyone, i want to create a Dax Measure for Average Severity Score for each category by grouping risk type.
My Fact_Claim_Service_Provider looks like this,
Service_Center_ID | Risk_Type_ID | Severity Score | Severity Benchmark | Claim Count |
3284 | 1143 | 112 | 369 | 5 |
3284 | 1143 | 115 | 369 | 4 |
3284 | 1143 | 105 | 369 | 10 |
3284 | 1187 | 91 | 327 | 20 |
3284 | 1115 | 84 | 327 | 15 |
3285 | 1143 | 112 | 369 | 5 |
3285 | 1143 | 115 | 369 | 4 |
3285 | 1143 | 105 | 369 | 10 |
3285 | 1187 | 91 | 327 | 20 |
3285 | 1115 | 84 | 327 | 15 |
3287 | 1143 | 112 | 369 | 5 |
3287 | 1143 | 115 | 369 | 4 |
3287 | 1143 | 105 | 369 | 10 |
3287 | 1187 | 91 | 327 | 20 |
3287 | 1115 | 84 | 327 | 15 |
I need to group Risk_Type_ID and arrive average severity score for each service center.
Ex : for Service_Center_ID 3284, formula Average Severity Score =((112+115+105)*19/54)+(91*20/54)+(84*15/54)
The output 173.84. Same need to be done for all service center.
Can anyone help me on the dax measure.
Solved! Go to Solution.
Hi, @Asfaa5
Please try the below measure.
Avg Severity Score =
VAR currentcenterid =
MAX ( 'Table'[Service_Center_ID] )
VAR newtable =
SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[Service_Center_ID] = currentcenterid ),
'Table'[Risk_Type_ID],
"@securityscore", SUM ( 'Table'[Severity Score] ),
"@claimcount", SUM ( 'Table'[Claim Count] ),
"@claimcountall",
CALCULATE (
SUM ( 'Table'[Claim Count] ),
ALLEXCEPT ( 'Table', 'Table'[Service_Center_ID] )
)
)
RETURN
SUMX ( newtable, DIVIDE ( [@securityscore] * [@claimcount], [@claimcountall] ) )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi, @Asfaa5
Please try the below measure.
Avg Severity Score =
VAR currentcenterid =
MAX ( 'Table'[Service_Center_ID] )
VAR newtable =
SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[Service_Center_ID] = currentcenterid ),
'Table'[Risk_Type_ID],
"@securityscore", SUM ( 'Table'[Severity Score] ),
"@claimcount", SUM ( 'Table'[Claim Count] ),
"@claimcountall",
CALCULATE (
SUM ( 'Table'[Claim Count] ),
ALLEXCEPT ( 'Table', 'Table'[Service_Center_ID] )
)
)
RETURN
SUMX ( newtable, DIVIDE ( [@securityscore] * [@claimcount], [@claimcountall] ) )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
69 | |
48 | |
44 | |
19 | |
15 |