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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PN4
Regular Visitor

Unpivot Function

 

 

Hi All,

 

I am connecting  a sharepoint list to Power Bi.  Also could export the data into excel to attempt the same,

 

Here is an example of what I'm trying to accomplish.  The colored columns corrospond to eachother and I want their data to remain connected. (I acually have 7 total columns I want connected but shortened it to three so I could demonstrate)

 

Current Raw Data:

Example1.JPG

 

Unpivot: (What I want the data to look like)

example 2.JPG

 

Am I making this harder than it really is?

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Hi @PN4 

 

1) Check columns "Site", "Manager" and "Date" -> Unpivot other columns

2) Check column "Attribute" and split column with " " as delimiter

3) Pivot back on the first column of the splitted columns with "Value" in the values area.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

5 REPLIES 5
ImkeF
Community Champion
Community Champion

Hi @PN4 

 

1) Check columns "Site", "Manager" and "Date" -> Unpivot other columns

2) Check column "Attribute" and split column with " " as delimiter

3) Pivot back on the first column of the splitted columns with "Value" in the values area.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

PN4
Regular Visitor

Thanks @ImkeF !

 

I am having issues with step 2 in splitting column "Attribute".

 

9.18screenshot1.JPG

9.18screenshot2.JPG

 

This this what the output is supposed to look like in splitting the column?

 

I'll also need some further explaination on how to perform step 3 and how to "Pivot back on the first column with "value"..."  Maybe that will become more clear to me after step 2 is complete.

 

Thanks again for your time in explaining this.

ImkeF
Community Champion
Community Champion

There's and underscore "_" in your column names. So you have to use that as the delimiter instead. Just the _, no quotes.

 

The pivot-back will be a pivot on column Attribute.1

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

PN4
Regular Visitor

@ImkeF 

This is awesome!  Thank you.  I'm still playing with this on the front side to see if I can get it to do what I had set up in Excel when I was manually unpivoting.  It appears to be adding up total records which is giving one too many, or when I add "attribute 2" it is missing the records without scores (which I need). 

 

You have solved my intitial problem though, in transforming the data, so thank you very much.

 

 

Capture.JPG

 

 

Capture2.JPG

Greg_Deckler
Community Champion
Community Champion

I feel like this is something that @ImkeF  can help with.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.