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
Matthias
Frequent Visitor

Unpivot Repeating Attribute Value Columns

Hi

 

I am working on a report in an IT context. I have a table 'Projects', the work of each project can be distributed according to several domains. Users enter this information in Domain - Distribution Percentage Fields. They have the option to select 5 domains and assign distribution percentages.

This leads to the following dataset.

 

IDDomain1Domain1 PercentageDomain2Domain2 PercentageDomain3Domain3 PercentageDomain4Domain4 PercentageDomain5Domain5 Percentage
1SAP20CRM20MES20Sharepoint20Server20
2MES80CRM20      
3SAP100        

 

How can I transform my dataset to achieve the underlying table?

 

IDDomainPercentage
1SAP20
1CRM20
1MES20
1Sharepoint20
1Server20
2MES80
2CRM20
3SAP100

 

 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

In the Query Editor

1) Ctrl+Select the 5 Domain Columns

2) Transform tab - Unpivot Columns - select Unpivot Only Selected Columns

3) Select the Value column - click the drop-down button in the column’s header - uncheck the Blank value

4) Ctrl+Select the 3 columns - ID, Domain1 Percentage and Value

5) Right-click on any one the selected columns’ Headers - select Remove Other Columns

6) Finally rename the Domain1 Percentage column - Domain and the Value column - Percentage

There it is! Smiley Happy

 

View solution in original post

1 REPLY 1
Sean
Community Champion
Community Champion

In the Query Editor

1) Ctrl+Select the 5 Domain Columns

2) Transform tab - Unpivot Columns - select Unpivot Only Selected Columns

3) Select the Value column - click the drop-down button in the column’s header - uncheck the Blank value

4) Ctrl+Select the 3 columns - ID, Domain1 Percentage and Value

5) Right-click on any one the selected columns’ Headers - select Remove Other Columns

6) Finally rename the Domain1 Percentage column - Domain and the Value column - Percentage

There it is! Smiley Happy

 

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.