Forum Discussion

Covington's avatar
Covington
Helper I
6 years ago
Solved

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.

 

 

8 Replies

    • Covington's avatar
      Covington
      Helper I

      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.

  • HotChilli's avatar
    HotChilli
    Community Champion

    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.

    • Covington's avatar
      Covington
      Helper I

      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's avatar
        HotChilli
        Community Champion

        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.