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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Pivot and Unpivot: How to Split 2 Value Metrics in a Column (Power Query in Power BI)

Hi, how do I split the Column "2 Value Measures" into 2 Columns, each has one measure? You can start from either photo 1 or photo 2. Thank you for your help!

 

Capture1.PNGCapture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi there,

 

First, you need to make some sort of classification. I am not sure if the rest of the columns can be used for this, but I notice that the two measures are in a very different scale - hundreds of thousands and numbers below 10. So here's how, in two steps, you can achieve what you're looking for:

Step1: Categorize the Measures

Step 1 - categorization.jpg

 

Step 2: Select, in this order, the categorization column and the one with the measures and use the Pivot option in the Transform section 

Step 2 - Pivot the values.jpg

 

Done:

Final result.jpg

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi there,

 

First, you need to make some sort of classification. I am not sure if the rest of the columns can be used for this, but I notice that the two measures are in a very different scale - hundreds of thousands and numbers below 10. So here's how, in two steps, you can achieve what you're looking for:

Step1: Categorize the Measures

Step 1 - categorization.jpg

 

Step 2: Select, in this order, the categorization column and the one with the measures and use the Pivot option in the Transform section 

Step 2 - Pivot the values.jpg

 

Done:

Final result.jpg

Anonymous
Not applicable

It works! Thank you very much, Vitali87

 

To categorize the measures, I used the M code:

= Table.AddColumn(#"Source", "Custom", each if Text.StartsWith([2 Value Measures], "$") then "Sales" else "Tax")

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors