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
Anonymous
Not applicable

Get data from one column in 2 different columns

Hello,

 

If I have these 2 tables:

 

id      name      age
1       Jack         23
2       Peter       34
3       Loic         56

 

Id       UserId         feature          value
1           1                eyes           brown
2           1                sex             male
3           2                eyes           blue
4           2                sex              male
5           3                eyes           brown
6           3                sex             female

 

And I would like to get the following data extend, how I can get it?

 

id          name          age          eyes        sex
1           Jack            23            brown     male
2           Peter          34            blue        male
3           Loic            56            blown      female

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to do the following steps:

  • Table2:
    • Select columns feature and value
    • Pivot columns without aggreagation of values
    • Fill down  on eyes column
    • Fill up on sex column
    • Remove ID column
    • Remove duplicates
  • Table1
    • Merge with table2
    • Expand sex and eyes column

Check PBIX file attach.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

You need to do the following steps:

  • Table2:
    • Select columns feature and value
    • Pivot columns without aggreagation of values
    • Fill down  on eyes column
    • Fill up on sex column
    • Remove ID column
    • Remove duplicates
  • Table1
    • Merge with table2
    • Expand sex and eyes column

Check PBIX file attach.

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.