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
LeahS
Frequent Visitor

Relationships with Column Names

I'm new to Power BI.  I'm trying to create a relationship between my tables of client information and the data itself for filtering.  Right now in my data tables, the client name is the column name.  I would like to match this to a value in the "client" column of my client information table, but can't seem to figure out how.  Do any of you have any ideas on how to work around this issue?

 

Example

"Le St", a value in the "Clients" column of client information table

In Level 1 Table, "Le St" is a column name with rows being dates.  So each row has how many level 1's "Le St" had on that date.

 

Thanks!

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @LeahS ,

 

To create a relationship between your client information table and the Level 1 table, you'll need to unpivot the Level 1 table so that the client names become values in a single column instead of being column names.


Go to the Data view->Select the Level 1 table->In the Home tab, click on Transform Data to open the Power Query Editor->In the Power Query Editor, select all columns except the date column->Right-click on one of the selected columns and choose Unpivot Columns->Rename the generated Attribute column to "Clients" and the Value column to something meaningful, like "Level 1 Count"->Click Close & Apply to apply the changes

Now, you should have a transformed Level 1 table with a "Clients" column that can be used to create a relationship with the client information table. To create the relationship:


Go to the Model view->Drag the "Clients" column from the Level 1 table to the "Clients" column in the client information table->Power BI will automatically create a relationship between the two tables.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
LeahS
Frequent Visitor

Thanks Neeko!  That worked for me.  The relationships are all functioning now.  I appreciate the help!

v-tangjie-msft
Community Support
Community Support

Hi @LeahS ,

 

To create a relationship between your client information table and the Level 1 table, you'll need to unpivot the Level 1 table so that the client names become values in a single column instead of being column names.


Go to the Data view->Select the Level 1 table->In the Home tab, click on Transform Data to open the Power Query Editor->In the Power Query Editor, select all columns except the date column->Right-click on one of the selected columns and choose Unpivot Columns->Rename the generated Attribute column to "Clients" and the Value column to something meaningful, like "Level 1 Count"->Click Close & Apply to apply the changes

Now, you should have a transformed Level 1 table with a "Clients" column that can be used to create a relationship with the client information table. To create the relationship:


Go to the Model view->Drag the "Clients" column from the Level 1 table to the "Clients" column in the client information table->Power BI will automatically create a relationship between the two tables.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

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.