Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Rakel
Frequent Visitor

How to "unpivot" data in a table based on calculated columns

Hello,

 

I have a table with many columns. Based on those columns, I have created a set of calculated columns to get some alerts. 

The data is in a layout like this one (and more much fields):

Rakel_0-1665478311437.png

and I need to unpivot these rows to get something like this: 

Rakel_1-1665478349938.png

I've tried to unpivot it but the only way I know is on the load /transform step and there I don't have the calculated columns.

Can you please help me to get this? 

 

Thanks in advance,

        Raquel 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Rakel , if you have created those columns in DAX, you can not unpivot them. In power Query you can Unpivot, but column need to created in power query

https://radacad.com/pivot-and-unpivot-with-power-bi

 

In dax you have to create a new table

union (

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 1]),

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 2]),

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 3]),

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 4]))

View solution in original post

2 REPLIES 2
Rakel
Frequent Visitor

Thank you very much for your help.

amitchandak
Super User
Super User

@Rakel , if you have created those columns in DAX, you can not unpivot them. In power Query you can Unpivot, but column need to created in power query

https://radacad.com/pivot-and-unpivot-with-power-bi

 

In dax you have to create a new table

union (

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 1]),

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 2]),

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 3]),

Summarize(Table ,Table[Contact Id], Table[Contact Name], Table1[Calculated COlumn 4]))

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.