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
Covington
Helper I
Helper I

Power Query - Help with pivoting my data like...

I have some data that I need to pivot and am at a bit of a loss.  Maybe it is the quarantine or maybe my brain it in just too much of a fog.  Regardless... my data looks like:

 

NodeTag
LINE41ST_SHIFT_PG
LINE42ND_SHIFT_PG
LINE43RD_SHIFT_PG
LINE251-136-FLT
LINE351-136-FLT
LINE451-136-FLT
LINE151-136-FLT

 

I need to be able to pivot the data like this:

TagLINE1LINE2LINE3LINE4LINE5
1ST_SHIFT_PG   YES 
2ND_SHIFT_PG   YES 
3RD_SHIFT_PG   YES 
51-136-FLTYESYESYESYES 

 

Now - it doesn't hae to show YES.  Just needs to show tag-by-tag and what Node it is associated with.  

 

Appreciate any help that will get me out of my  brain-funk.

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Create a simple Pivot Table.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Create a simple Pivot Table.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you!  That worked pretty easily 🙂  I still used Power Query (not BI) to get the data into the format that I needed, but this got me to the final step.

 

Now - I loaded PowerBI.  But I do not see any sort of Matrix Visual option anywhere.  Would be nice to have a look at that also just to broaden my knowledge.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
HotChilli
Super User
Super User

I think you can leave the data as it is.

Just use a matrix visual, pull Tag on to rows, Node on to columns, and create a measure for COUNT(Tag) and put that in Values.

The problem is that it would take a long time to figure it out 'as is' from the perspective of what needs to be accomplished.  The consumer of the data will need to be able to look at each TAG and then decide which AREAS are appropriate for the data.  To look at it 'as is' would take a very long time and they would really have to manually convert it to the way I asked above anyway 😞

 

I'm not sure why the table squished everything together up there either.  Looks funky after it posted.

@HotChilli is right.  Here is what it looks like when you follow that suggestion.  Your example data didn't have Line5 so it doesn't match your output exactly.

 

lines.png

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


I think I see my problem now.  I have Power Query, not Power BI 😞  So - essentially only Excel 365 for Business.  I don't see the Matrix Visual in here - so assume it is part of that package and realize now I'm in the BI community 🙂

There may be a slight misunderstanding. I mean there won't be any need to transform the data in Power Query.

 

Use a matrix visual and follow my suggestion.  Let me know how you get on.

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.