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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
TariqArnabi
Frequent Visitor

Rating system not giving me a total

I'm looking to create a rating system that will display the overall health of a division 
example; anything greater than 80% is 1 point, 50% - 79% will be .5 points, 49% and less is 0 points. 

i created the following dax which was able to give me the correct values, but i was not able to get the table to calculate a total, its giving me an average 

Overall point =

VAR _Claims     =   SWITCH( TRUE(),
                [% of Claims Assigned]  >= .80, 1,
                [% of Claims Assigned] >= .60 , .5,
                0
                )
VAR _Risk       =   SWITCH( TRUE(),
                [% of Risk Assigned]  >= .80, 1,
                [% of Risk Assigned] >= .60 , .5,
                0
                )
VAR _Casualty   =   SWITCH( TRUE(),
                [% of Casualty Assigned]  >= .80, 1,
                [% of Casualty Assigned] >= .60 , .5,
                0
                )
VAR _Property   =   SWITCH( TRUE(),
                [% of Property Assigned]  >= .80, 1,
                [% of Property Assigned] >= .60 , .5,
                0
                )
VAR _Primary   =   SWITCH( TRUE(),
                [% of Primary Assigned]  >= .80, 1,
                [% of Primary Assigned] >= .60 , .5,
                0
                )
VAR _Cyber     =   SWITCH( TRUE(),
                [% of Cyber Assigned]  >= .80, 1,
                [% of Cyber Assigned] >= .60 , .5,
                0
                )        
VAR _Total      = CALCULATE(_Claims + _Risk + _Casualty + _Property + _Primary +_Cyber)
RETURN
_Claims + _Risk + _Casualty + _Property + _Primary +_Cyber

Expected visual the total is 32.5

TariqArnabi_0-1675288422710.png

current visual is giving an average

TariqArnabi_1-1675288520967.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@TariqArnabi , Change return like this and try

 

Sumx(Values(Table[Region]), calculate(_Claims + _Risk + _Casualty + _Property + _Primary +_Cyber))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
v-tangjie-msft
Community Support
Community Support

Hi @TariqArnabi ,

 

Please try using this measure.

total =
IF (
    HASONEVALUE ( 'Table'[Region] ),
     'Table'[Overall],
    CALCULATE ( 'Table'[Overall], ALL ( 'Table' ) )
)

Or:

Measure =
SUMX(
    SUMMARIZE(
        'Table',
        'Table'[Region],
        "total",[Overall]
    ),
    [total]
)

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

amitchandak
Super User
Super User

@TariqArnabi , Change return like this and try

 

Sumx(Values(Table[Region]), calculate(_Claims + _Risk + _Casualty + _Property + _Primary +_Cyber))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

This worked.  I also created a seperate measure to return the correct Total since SUMX does a Row by Row Evaluation.  it was returning an incorrect Total.  

I created a new measure if you need an overall TOTAL in the end.  

Overall Point_Total =
IF (
        ISINSCOPE(Organization[Region]),
        [Overall point],      ----- the Variable table created initially
        SUMX( SUMMARIZE( Table, Table[Region],
         "__Value",
         [Overall point]), [__Value]))

TariqArnabi_0-1694112290086.png

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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