Forum Discussion

Asfaa5's avatar
Asfaa5
Frequent Visitor
5 years ago
Solved

Help in Dax Measure

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...
  • Jihwan_Kim's avatar
    5 years ago

    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.