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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vibhoryadav23
Helper II
Helper II

Create new table by transposing/Crosstab a data table

Hi, 

 

I need to crosstab/transpose data from one table to create a new table as shown in example below.

 

Original Table:

UserWeek     Status
A1Week1     Active
A1Week2     Inactive
A1Week3     Deleted
A2Week1     Active
A2Week2     Active
A2Week3     Deleted
A3Week1     Active
A3Week2     Active
A3Week3     Active
A4Week3     Idle
A5     Week2     Active
A5Week3Active

 

New Table/Changed format/Desired output:

UserWeek1Week2Week3
A1Active     Inactive     Deleted
A2Active     Active     Deleted
A3Active     Active     Active
A4  Idle
A5 Active     Active

Can anyone help me with the same? Thanks in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@vibhoryadav23 ,

In matrix viusal , Week on column , Max of Status measure as value

 

 

Or if need a new table, Unpivot in Power Query- Take max of status -> If it does not give Option, After table is created you will see List.Count in script(formula), Make that List.Max

 

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@vibhoryadav23 ,

In matrix viusal , Week on column , Max of Status measure as value

 

 

Or if need a new table, Unpivot in Power Query- Take max of status -> If it does not give Option, After table is created you will see List.Count in script(formula), Make that List.Max

 

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

Hi @amitchandak ,

 

Thanks for your response. The second option works but it changes my current data. Is it possible to create a new table instead of changing the existing table?

@vibhoryadav23 , Right click on table in power query and duplicate. Or Copy paste , then unpivot

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors