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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
TomaKavi
Helper I
Helper I

Switch not showing correct result

Hello guys, 
I have a problem and I am desperate. The below DAX is not showing proper result. If i hard code it and replace [SR1100 Total test] with lets say ,,10000,, it works, shows 10000 in the specific row and other figures are measured properly as [Total Value]. But If I leave the [SR1100 Total test] it will show 0 (its becasue the  [Total Value] was defined to show 0 if its blank.

This measure is simple [SR1100 Total test]  =
CALCULATE (
[Total Value],
Total_2021[Consolidation account]
IN {
"V10000",
"V20000",
"V30000"
}
)

Switch Values =
VAR CurrentItem = SELECTEDVALUE( Conso_Temp[Description - Normalized] )

RETURN
SWITCH( TRUE(),
CurrentItem = "Operating profit or loss (+/-)", [SR1100 Total test],
CALCULATE( [Total Value], FILTER( Conso_Temp,Conso_Temp[Description - Normalized] = CurrentItem )))
 
as you can see it shows 0 but should be (lets say 143900) the Value above is correct.
 
TomaKavi_2-1655117796791.png
Table where I show these result is connected to Fact Table where the ,,Total Value,, are counted. I also need to filter it via country a loop up table which has direct connection to Fact table. I use the SWITCH in a Table vizual which is take from Conso Temp. 
TomaKavi_0-1655117553869.png

 Any ideas why I cant see what I need? 

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @TomaKavi 

I am so glad to hear that your problem has been solved , please consider Accept it as the solution to help the other members find it more quickly. 

 

Best Regards,
Community Support Team _ Ailsa Tao
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

3 REPLIES 3
Anonymous
Not applicable

Hi @TomaKavi 

I am so glad to hear that your problem has been solved , please consider Accept it as the solution to help the other members find it more quickly. 

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

TomaKavi
Helper I
Helper I

actually I have added into the
SR1100=

CALCULATE (
[Total Value],

Allselected (),All() Total_2021[Consolidation account]........ works now

johnt75
Super User
Super User

Try changing the measure to

[SR1100 Total test]  =
CALCULATE (
[Total Value],
Total_2021[Consolidation account]
IN {
"V10000",
"V20000",
"V30000"
},
REMOVEFILTERS(Conso_Temp[Description - Normalized])
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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