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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Zosy
Helper II
Helper II

SWITCH measure not totaling correctly in table

Hi,

I am hoping someone will see what I did wrong and help me correct it. I want to have the total points under the Total column. At the moment it displays 0 instead of 50.

 

Points = SWITCH(
    TRUE(),
    [Percentage]>0 && [Percentage]<0.7, 0,
    [Percentage]>=0.7 && [Percentage]<0.8, 10,
    [Percentage]>=0.8 && [Percentage]<0.9, 15,
    [Percentage]>=0.9 && [Percentage]<1, 20,
    [Percentage]>=1,25,
    0)

 



Screenshot 2024-07-05 124834.png
Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Zosy ,

I can not open the file link.

Based on my testing, please try the following methods again:

1.Create the sample table.

vjiewumsft_0-1720601821837.png

2.Create the new measure to calculate the point.

Points = 
SWITCH(
    TRUE(),
    [Percentage] > 0 && [Percentage] < 0.7, 0,
    [Percentage] >= 0.7 && [Percentage] < 0.8, 10,
    [Percentage] >= 0.8 && [Percentage] < 0.9, 15,
    [Percentage] >= 0.9 && [Percentage] < 1, 20,
    [Percentage] >= 1, 25, 0)

3.Create the new measure to sumx.

Measure 2 = SUMX(VALUES('Table'[Date]), [Points])

4.Create the new measure to display total.

Display Value = 
SWITCH(
    VALUES('Table t'[Column1]),
    "Sales", [Sales],
    "Target", [Target],
    "Percentage", [Percentage],
    "Points", [Measure 2]
)

5.Drag the measures into the matrix visual.

vjiewumsft_1-1720601837314.png

6.The result is shown below.

vjiewumsft_2-1720601912407.png

 

Best Regards,

Wisdom Wu

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

6 REPLIES 6
Anonymous
Not applicable

Hi @Zosy ,

Based on the description,  could you provide the sample data? Is percentage a row or a measure? Besides, the Qtr whether is column or a measure.

 

Best Regards,

Wisdom Wu

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

Hi @Anonymous ,

The percentage is a measure and the Qrt is a field coming from the Date table, splitting the Sales, Target measures by quarters in the matrix. Here is the link for the file.
SWITCH measure table total incorrect.pbix 

Thank you

Anonymous
Not applicable

Hi @Zosy ,

I can not open the file link.

Based on my testing, please try the following methods again:

1.Create the sample table.

vjiewumsft_0-1720601821837.png

2.Create the new measure to calculate the point.

Points = 
SWITCH(
    TRUE(),
    [Percentage] > 0 && [Percentage] < 0.7, 0,
    [Percentage] >= 0.7 && [Percentage] < 0.8, 10,
    [Percentage] >= 0.8 && [Percentage] < 0.9, 15,
    [Percentage] >= 0.9 && [Percentage] < 1, 20,
    [Percentage] >= 1, 25, 0)

3.Create the new measure to sumx.

Measure 2 = SUMX(VALUES('Table'[Date]), [Points])

4.Create the new measure to display total.

Display Value = 
SWITCH(
    VALUES('Table t'[Column1]),
    "Sales", [Sales],
    "Target", [Target],
    "Percentage", [Percentage],
    "Points", [Measure 2]
)

5.Drag the measures into the matrix visual.

vjiewumsft_1-1720601837314.png

6.The result is shown below.

vjiewumsft_2-1720601912407.png

 

Best Regards,

Wisdom Wu

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

Thank you for your help! It worked brilliantly !

Greg_Deckler
Community Champion
Community Champion

@Zosy First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

I had a look at the materials but I can't make the measure work. I don't know what I should change.

Points = 

VAR PointsQuarter = SWITCH(
    TRUE(),
    [Percentage]>0 && [Percentage]<0.7, 0,
    [Percentage]>=0.7 && [Percentage]<0.8, 10,
    [Percentage]>=0.8 && [Percentage]<0.9, 15,
    [Percentage]>=0.9 && [Percentage]<1, 20,
    [Percentage]>=1,25,
    BLANK())
VAR _table= SUMMARIZE('Date','Date'[Quarter],"_value", PointsQuarter)

    RETURN

    IF(HASONEVALUE('Date'[Quarter]),PointsQuarter,SUMX(_table,[_value]))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors