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

Measures & Switch & Customized Matrix - calculation using measures & assignment to custom matrix

Hello All, 

My scenarion: 

- I have fully customized matrix 

- I would like to keep sum of values in the measures 

- I would like to assign measures to the customized matrix using SWITCH function 

Problem: 

- I have difficulties to make some mathematical calculation in measueres and  based on the measures 

 

Theare my measures 

koooala_0-1617345054550.png

koooala_4-1617345148146.png

koooala_3-1617345114702.png

koooala_5-1617345207976.png

 

Gross Margin Level (CURR) is represent value in case of direct assignment to seperate matrix but doesn't work with SWITCH function

koooala_7-1617345450668.png

 

Please check the following pictures to see the result I would like to obtain

koooala_6-1617345377588.png

 

Thank you in advance for you reply. 

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

 

First, returning a mixture of data types from a measure is a VERY BAD idea. Refrain from doing this or you'll suffer rather sooner than later. You should not return an empty string "" from the SWITCH measure. Just remove the piece from the formula and DAX will automatically return BLANK if no option out of the list is selected, which is the correct thing to do. It might even fix your problem...

Anonymous
Not applicable

Hello @Anonymous 
Can you return some text instead of "" values? Check if it's working fine.
Can you please share some sample data after removing sensitive information?

Anonymous
Not applicable

with text instead of values works well. 

koooala_0-1617350916581.png

 

 

Anonymous
Not applicable

Hey @Anonymous 
Can you please share your pbix file after removing the sensitive information?

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.