Forum Discussion

Aldimar_Junior's avatar
Aldimar_Junior
Frequent Visitor
3 years ago
Solved

Melt Rows in a table

Hi everyone, I'm pretty new to powerBI and DAX.. and I'm having some trouble trying to "melt" a table:

 

I have the following table

user.iduser.fieldCodeuser.fieldRuleuser.fieldValue
1000106689512288AHV222
1000106674512288Data Analist
1000106642512288Head Quarters

 

All I need to do is tranform the above into this:

user.idKeyRoleLocation

1000

AHV222Data AnalistHead Quarters

 

I Know what each code means, so I can name the column, but when I try doing that on PBI I get the following:

user.idKeyRoleLocation

1000

  Head Quarters
1000 Data Analist 
1000AHV222  

 

the user.id repeats and I get the values spread apart, is there anything like a "group by user.id" in PBI?

 

Can anyone give me a hand?

 

Thanks in advance!

  • Aldimar_Junior ,

    Assumed you tried to "Pivot Column" in Power Query. 

    This will work but first remove the user.fieldRule column

    Then Pivot on the fieldCode column

    This is what I get, which I believe is what you are looking for.

    Hope you can get this to work for you.

    Regards,

3 Replies

  • rsbin's avatar
    rsbin
    Community Champion

    Aldimar_Junior ,

    Assumed you tried to "Pivot Column" in Power Query. 

    This will work but first remove the user.fieldRule column

    Then Pivot on the fieldCode column

    This is what I get, which I believe is what you are looking for.

    Hope you can get this to work for you.

    Regards,

    • Aldimar_Junior's avatar
      Aldimar_Junior
      Frequent Visitor

      I dont think this would work in my case, because my values are in different columns, not in only one like yours

  • Oh, never mind, I mistook myself, doing lots of things at the same time... hehe, I'll give it a try, thank you