Forum Discussion
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.id | user.fieldCode | user.fieldRule | user.fieldValue |
| 1000 | 106689 | 512288 | AHV222 |
| 1000 | 106674 | 512288 | Data Analist |
| 1000 | 106642 | 512288 | Head Quarters |
All I need to do is tranform the above into this:
| user.id | Key | Role | Location |
1000 | AHV222 | Data Analist | Head 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.id | Key | Role | Location |
1000 | Head Quarters | ||
| 1000 | Data Analist | ||
| 1000 | AHV222 |
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!
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
- rsbinCommunity Champion
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_JuniorFrequent Visitor
I dont think this would work in my case, because my values are in different columns, not in only one like yours
- Aldimar_JuniorFrequent Visitor
Oh, never mind, I mistook myself, doing lots of things at the same time... hehe, I'll give it a try, thank you