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.
Originally I have a data with many to many relationship that look like the picture below:
I am told this is a bad practice, so I created a look up table that look like this.
But the problem with look up table is that custtomer nnumber in table1 does not filter up to the lookup table and then filter down to table2.
So I decide to enable by directional filter that look like this.
But bi-directional filter is also a bad design, can anyone tell me how you would design your datamodel if you want to subtract cost from sales for the same customer number.
i have two ideas in mind:
1) you bring the cost column to table1, by merging table1 with table2 in Power Query. Then you have everything in one table - table1.
2) you write plot the visuals with customer number of the lookup table and a measure like:
Profit = SUM(table1[Sales])-SUM(table2[Cost])
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
11 | |
10 | |
7 |