Forum Discussion

Analitika's avatar
Analitika
Post Prodigy
5 years ago

Add custom field to selectedvalue column in matrix

I have matrix where are column from table1[types], which contains 3 types 1. fuel 2.diesel 3. Adblue, then i link this table to table2 which has two columns, 1. sum1 2. sum2

 

i want to show in matrix 4 type Costs and get value from column sum2

 

Types  Sum

fuel sum(table2[sum1])

diesel sum(table2[sum1])

Adblue   sum(table2[sum1])

Costs   sum(table2[sum2])  ' <--- Custom field

 

 

How to do that?

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Analitika,

    You can create a parameter table with all category and custom category types and use this to replace raw fields.
    Then you need to write a measure formula with switch function and selectedvalue to check current row content and return corresponding expression results.

    Write Conditional Statement Using SWITCH in DAX and Power BI 

    Regards,

    Xiaoxin Sheng

    • Analitika's avatar
      Analitika
      Post Prodigy

      Anonymous 

      No i cant, as category type then not included in main table and not showing in result matrix

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI Analitika,

        How about manually create them? You can use datatable function to define them if they not too many records.
        BTW, these categories not required to store in the main table, they are interacting with DAX functions and not need to link to raw table.
        Regards,
        Xiaoxin Sheng