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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-yetao1-msft
Community Support
Community Support

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
v-yetao1-msft
Community Support
Community Support

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors