Forum Discussion
Display One or more calculated columns under single column/heading in matrix layout
Hi Community,
I want to display One or more calculated columns under single column/heading in a matrix layout. I can do it easily for non calculated columns by unpivoting in 'Transform data' section, but calculated columns dont appear in transform data section.
Current display:
Expected display:
Many thanks in advance!
Hi Anonymous ,
Try this solution.
1. Export data (Don't aggregate data)
2. Unpivot the WaitTime1~5 columns in Edit Query.
3. Create a calculated column with DAX.
Column = SWITCH( [Attribute], "WaitTime1", "Stage1", "WaitTime2", "Stage1", "WaitTime3", "Stage2", "WaitTime4", "Stage2", "WaitTime5", "Stage3" )4. Create a matrix visual.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- amitchandak
Super User
Anonymous , first Unpivot and then create stage on as new calculated column
https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/New Column = Switch(True() ,
[waittime] in {"waittime1","waittime2"} , "Stage1",
[waittime] in {"waittime3","waittime4"} , "Stage2",
"Stage3"
)
Display in matrix with two columns waittime and stage
- AnonymousNot applicable
amitchandak how can I unpivot calculated columns? They dont appear in transform data section.
- AnonymousNot applicable
amitchandak any suggestions?
- Greg_Deckler
Community Champion
Anonymous - If I understand this correctly, you could do this with a custom matrix hierarchy: https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/963588#M428
- v-lionel-msft
Community Support
Hi Anonymous ,
Try this solution.
1. Export data (Don't aggregate data)
2. Unpivot the WaitTime1~5 columns in Edit Query.
3. Create a calculated column with DAX.
Column = SWITCH( [Attribute], "WaitTime1", "Stage1", "WaitTime2", "Stage1", "WaitTime3", "Stage2", "WaitTime4", "Stage2", "WaitTime5", "Stage3" )4. Create a matrix visual.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.