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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Switch formula not working on second VAR condition

Hi Expert

 

I have the following siwtch formula which only work for the first VAR condition, when selecting the options from the first slicer, the second VAR conidition does nothing on selecting the second slicer......cannot see error.

 

ProfitabilityMeasureSwitch = 
VAR ProfitbabilityMeasure = SELECTEDVALUE(ProfitabilityMeasures[MeasureName])
VAR ReportingMeasure = SELECTEDVALUE(Reporting[Reporting])
RETURN 

SWITCH(TRUE(),
    ProfitbabilityMeasure = "Gross Margin", [Total Margin %] ,
    ProfitbabilityMeasure = "Net Sales", [Net Sales @AOP BM %],
    ReportingMeasure = "NOE", [YoY NOE Variance],
    ReportingMeasure = "Reported", [YoY Reported Variance],
BLANK())
1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi Route11,

 

What does your table look like? Does any relationship between table 'ProfitabilityMeasures' and 'Reporting'? The first selectedvalue in one table will automatically filter the second table. So possiblely because the first value filter the second table but the second value you selected is not in the filtered second table.

 

Regards,

Jimmy Tao

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi Route11,

 

What does your table look like? Does any relationship between table 'ProfitabilityMeasures' and 'Reporting'? The first selectedvalue in one table will automatically filter the second table. So possiblely because the first value filter the second table but the second value you selected is not in the filtered second table.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy..

 

No relationships exits between the two tables and the fact table...

Table 1.     Index

GMARGIN      1

NSALES          2

 

Table 2.  similar... I have used the correct sames and speelings in  each table..."but the second value you selected is not in the filtered second table" ho can i fix this......

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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