Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

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 

 

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

 

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

 

Thank you in advance for you reply. 

4 Replies

  • Anonymous's avatar
    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's avatar
      Anonymous
      Not applicable

      with text instead of values works well. 

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

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

  • Anonymous's avatar
    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...