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
Anonymous
Not applicable

Model Relationship vs SWITCH vs Custom Matrix.

Hello All, 
This time I have following issue...

 

For the following funcions and following model funcion SWITCH works well

koooala_2-1617715213411.png

koooala_3-1617715302612.png

koooala_4-1617715338617.png

koooala_5-1617715349387.png

koooala_6-1617715389737.png

koooala_7-1617715407718.png

 

 

BUT for the following model and following funcions SWITCH doesn't work. 

koooala_8-1617715581271.png

koooala_9-1617715661765.png

koooala_10-1617715697225.png

koooala_11-1617715714724.png

koooala_12-1617715731797.png

koooala_13-1617715749104.png

 

I would like to understand what is the logic behind in one case (model without ralationship) I can assign sum of two values to Gross margin label but in other case (model with relationship) I can't? 
How to upragre my DAX to resolve this issue? 

Thank you in advance fo your reply. 
Thank 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

 

It's easy to explain the behaviour if you know how filters interplay with CALCULATE, especially nested CALCULATE's.

 

In the first example, the table 'Admin Categories' does not filter anything, even if you put its columns in a visual; hence you can see values. In the second example, 'Admin List' filters 'Admin Account'. Now, if you put a column from 'Admin List' in a visual, 'Admin Account' gets cross-filtered and the filter is "Gross Margin Level..." Hence, only rows which join to this value are visible in the current context. Since your measures [1] and [2] filter (in their definition) on the field 'Admin Account'[Level 1] and the values you want to filter by have been eliminated by the filter coming from 'Admin List'... well, therefore blank is returned.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Also

In the second case in Switch replace selectedvalue with Max and text once.

Anonymous
Not applicable

Hi, 
there is pbx file 
https://drive.google.com/drive/folders/1foPUnS13r7KeZsLDHOiU6JsOk5npvWci?usp=sharing 

i have changed the scenario like following

koooala_0-1617787750401.png

but issue is the same, 
I can't make mathematical calculation and switch to France + Germany, 
Switch funcion works only for txt message. 

Thank you in advance for your reply how to solve this issue. 



Anonymous
Not applicable

@Anonymous 

 

It's easy to explain the behaviour if you know how filters interplay with CALCULATE, especially nested CALCULATE's.

 

In the first example, the table 'Admin Categories' does not filter anything, even if you put its columns in a visual; hence you can see values. In the second example, 'Admin List' filters 'Admin Account'. Now, if you put a column from 'Admin List' in a visual, 'Admin Account' gets cross-filtered and the filter is "Gross Margin Level..." Hence, only rows which join to this value are visible in the current context. Since your measures [1] and [2] filter (in their definition) on the field 'Admin Account'[Level 1] and the values you want to filter by have been eliminated by the filter coming from 'Admin List'... well, therefore blank is returned.

Anonymous
Not applicable

@Anonymous 
Beautiful!
Thank you very much! 
Now I understand more

Filter - ALL('ADMIN List')) solved my doubts. 
Best! 



 

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