Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Relationships between groups

Hey, I have a data set looking like screenshot following, but I have met a wall, and I know this is simple cut cannot conceptualise this:

In my set, an order can come from several sources: adwords, mail, blogger, call centre (cc). It can also have several sources (mainly adwords and blogger, or adwords and cc).

How can I create a relationship between a table I created (dim_team, on the left) and fact_order on the right, so that when I select a team, it will filter only orders made by that team (or shared with other teams).

 

Also, which visualisation do you recommend to show how mnay orders are shared between teams? I was hoping to use something like a Venn, rather than creating new conditional columns with permutations of sources.

 

MaWrob_0-1726583789043.png

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Anonymous so you should unpivot the data by following these steps:

 

Transform Data -> Select Order id and pK_Date columns -> Right click -> Unpivot other columns

 

It will add two columns, attribute and value, rename as you want it, close, and apply.

 

Now set the relationship from the dim table to the attribute column in the fact table and that's it. Now you should be able to slicer the fact table from the dim table



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi, @Anonymous  

Thanks for parry2k's concern about this issue.

parry2k's method is correct.


Based on the dataset you provided, first you should hold Ctrl and do a multi-select of the OrderID and PK_Date columns in PowerQuery Editor:

vfenlingmsft_0-1726714063528.png


Then select Unpivoted other columns:

vfenlingmsft_1-1726714127974.png

 

And the result should look like this, not like your result:

vfenlingmsft_3-1726714198888.png

And then close&reply.

 

Create a relationship between this table and your table dim_team:

vfenlingmsft_4-1726714500836.png

 

 

You can then add a Slicer for data filtering:

vfenlingmsft_5-1726714548170.png

 

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

parry2k
Super User
Super User

 how about this part? 

Now set the relationship from the dim table to the attribute column in the fact table and that's it. Now you should be able to slicer the fact table from the dim table

 

@Anonymous



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Anonymous so you should unpivot the data by following these steps:

 

Transform Data -> Select Order id and pK_Date columns -> Right click -> Unpivot other columns

 

It will add two columns, attribute and value, rename as you want it, close, and apply.

 

Now set the relationship from the dim table to the attribute column in the fact table and that's it. Now you should be able to slicer the fact table from the dim table



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

hello @parry2k  i think i managed to unpivot the tables without duplication of the orders, but how do I now use it so that I can select a channel and the table will filter based on which channel I want? channels are in different columns:

MaWrob_0-1726645947043.png

 

Anonymous
Not applicable

Thanks @parry2k , i tried that and this would create duplicate entries for orders which have more than channel assigned to them. Is there a way to avoid that?

parry2k
Super User
Super User

@Anonymous not sure what is the shape of your fact tables. Can you share? It should be unpivoted if it is not already.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hey @parry2k , it looks just like that, plus some columns. the flags from_adwords, from_blogger etc are a result of SQL modifications at the source (in power query I put a sql script)

 

OrderIDPK_Datefrom_adwordsfrom_bloggerfrom_ccfrom_mailfrom_organic 
1189922202/06/2024 00:0010010 
1189924302/06/2024 00:0010110 
1189924502/06/2024 00:0010010 
1189977702/06/2024 00:0010010 
1189980602/06/2024 00:0010010 
1189987302/06/2024 00:0010010 
1189987802/06/2024 00:0010010 
1189988402/06/2024 00:0010000 
1189989802/06/2024 00:0010010 
1189990302/06/2024 00:0010010 
1189995602/06/2024 00:0010010 
1189998902/06/2024 00:0010010 
1189999502/06/2024 00:0000010 
1190003602/06/2024 00:0010010 
1190007202/06/2024 00:0010010

 

 

MaWrob_0-1726584912202.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.