The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 🙂
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.
Proud to be a Super User! | |
Hi @menoskills
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
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
47 | |
44 |