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
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.