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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Analitika
Post Prodigy
Post Prodigy

Wrong total on switch

I use this formula

_TABLE=
VAR suma = SUM([suma])
VAR savi =
SWITCH(
SELECTEDVALUE(Table1[Names]),
"xcds",1,
SUM(Table3[suma])
)

VAR bp = suma-savi
VAR m= DIVIDE(bp,suma)

RETURN
IF(
ISINSCOPE(Table1[Names]) ,
SWITCH(
SELECTEDVALUE( 'Table2'[Names]),
"1", BLANK(),
"2", savi,
"3", BLANK(),
"4", BLANK()
),
IF(
ISINSCOPE('Table2'[Names]),
SWITCH(
SELECTEDVALUE( 'Table2'[Names]),
"1", suma,
"2", savi,
"3", bp,
"4", FORMAT ( m, "percent" )
)
)
)
 
But sum of savi is wrong in total as it count excepted value "xcds" which i want set to 1, so if xcds = 100 and others 50 , i got total 150 instead of 51, how to fix that?
2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Analitika ,

 

Unfortunately, I don't know your scenario. Could you share a sample file for me to test and know the scenario?

 

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

it does not matter, how sumx switch values?

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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