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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Modeling Relationship

menoskills_0-1689083279367.png

 


i want to create a relationship between the stores and sale table. however, by doing so, it will create an ambiguity error. my main goal is to create a relationship between these 3 tables, so that when i want to find out the sale of each store, it is possible. at the same time, when i want to find out the sale of each channel type, it is possible. so far i can only get the sale by channel type, but cant seem to do it for the store table. help would be greatly appreciated 🙂

 

2 REPLIES 2
jgeddes
Super User
Super User

There are likely a number of ways to do what you are looking for. 
My first suggestion would be try and delete the relationship between the Channel and Sales table. Then build a relationship between the Store and Sales table. In theory when you select a Channel it would then filter the Store table which would then filter the Sales table to get your result.
If that does not work, you leave your existing relationships and then you can build the relationship between Store and Sales and leave it inactive. In any measures you create that require the Store->Sales relationship you would need to use the USERELATIONSHIP() function.
Another approach would be to use the TREATAS() function to create a virtual relationship between the Store and Sales tables.
Hope this gets you pointed in the right direction.





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

Proud to be a Super User!





DemoFour
Responsive Resident
Responsive Resident

Hi @Anonymous 

Do you have keys in your dimension table for the store, and do you have a key in your sales table for the store the sale was made in? 

Your output does not seam to be that hard, but this depneds on the make up of your tables and data. 

Are you using this to model your schema?  Understand star schema and the importance for Power BI - Power BI | Microsoft Learn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.