Forum Discussion

Juan_AL's avatar
Juan_AL
Frequent Visitor
3 years ago
Solved

Hellp with DAX multiple measures

Good Morning,
i have a table that includes size information and need to do a basic measure, calculate the percentage per size,

what i ended up doing is pretty amateur, creating a custom column where i sum al size column and then i created individual measures per size dividin the size and the sum

this is how i have the size columns

 

the individual dax looks like this

125 =
IF(
    SUM(QCTable[Size Sum]) <> 0,
    CALCULATE(SUM(QCTable[Sizes.125_b]) / SUM(QCTable[Size Sum])),
    0
)
 
and my visiual like this

 

is there a better way to do this? i was trying to have them with seperate size table but since these are columns i cant think of another way

thanks

 

  • Juan_AL there is an easy and scalable way:

     

    - transform data
    - select all columns except size columns 
    - right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement
    - close and apply

    Write your measure, just one, and you can filter it by any attribute (which is size) you can also view it in pivot form in matrix visual by adding attribute column on columns.

2 Replies

  • Juan_AL there is an easy and scalable way:

     

    - transform data
    - select all columns except size columns 
    - right-click, unpivot other columns it will add two columns, attribute, and value, rename these as per your requirement
    - close and apply

    Write your measure, just one, and you can filter it by any attribute (which is size) you can also view it in pivot form in matrix visual by adding attribute column on columns.