Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hello,
I am using 2 tables.
1. Table "Data" comes regularly every month.
2. Table "Person" changes every quarter.
Staff shares territories. For example, 5/5 of the 10 boxes sold share. I can't do power bi. Can you help me with Table Association? Thanks.
Person Table
GRUP | TERRITORIES | PERSON | SHARE |
RED | ISTANBUL | 11R01-A.VELI | 1 |
RED | ANKARA | 11R01-A.VELI | 0,5 |
RED | IZMIR | 11R01-A.VELI | 1 |
RED | BURSA | 11R01-A.VELI | 0,5 |
RED | ANKARA | 11R02-O.BARAN | 0,5 |
RED | ADANA | 11R02-O.BARAN | 1 |
RED | BURSA | 11R02-O.BARAN | 0,5 |
Data Table
TERRITORIES | MARKET | PRODUCTS | Month | UNITS REPORT |
ISTANBUL | B | IDO | 1.02.2022 | 36 |
ISTANBUL | A | MID | 1.02.2022 | 38 |
ISTANBUL | A | IME | 1.02.2022 | 7 |
ISTANBUL | B | GEL | 1.02.2022 | 65 |
ISTANBUL | B | IDO | 1.01.2022 | 21 |
ISTANBUL | A | MID | 1.01.2022 | 24 |
ISTANBUL | A | IME | 1.01.2022 | 10 |
ISTANBUL | B | GEL | 1.01.2022 | 30 |
ANKARA | B | IDO | 1.02.2022 | 20 |
ANKARA | A | MID | 1.02.2022 | 4 |
ANKARA | A | IME | 1.02.2022 | 1 |
ANKARA | B | GEL | 1.02.2022 | 11 |
ANKARA | B | IDO | 1.01.2022 | 30 |
ANKARA | A | MID | 1.01.2022 | 1 |
ANKARA | A | IME | 1.01.2022 | 1 |
ANKARA | B | GEL | 1.01.2022 | 12 |
IZMIR | B | IDO | 1.02.2022 | 3 |
IZMIR | A | MID | 1.02.2022 | 4 |
IZMIR | A | IME | 1.02.2022 | 0 |
IZMIR | B | GEL | 1.02.2022 | 16 |
IZMIR | B | IDO | 1.01.2022 | 7 |
IZMIR | A | MID | 1.01.2022 | 2 |
IZMIR | A | IME | 1.01.2022 | 3 |
IZMIR | B | GEL | 1.01.2022 | 11 |
ADANA | B | IDO | 1.02.2022 | 14 |
ADANA | A | MID | 1.02.2022 | 33 |
ADANA | A | IME | 1.02.2022 | 28 |
ADANA | B | GEL | 1.02.2022 | 14 |
ADANA | B | IDO | 1.01.2022 | 31 |
ADANA | A | MID | 1.01.2022 | 23 |
ADANA | A | IME | 1.01.2022 | 18 |
ADANA | B | GEL | 1.01.2022 | 15 |
BURSA | B | IDO | 1.02.2022 | 10 |
BURSA | A | MID | 1.02.2022 | 4 |
BURSA | A | IME | 1.02.2022 | 3 |
BURSA | B | GEL | 1.02.2022 | 25 |
BURSA | B | IDO | 1.01.2022 | 11 |
BURSA | A | MID | 1.01.2022 | 3 |
BURSA | A | IME | 1.01.2022 | 2 |
BURSA | B | GEL | 1.01.2022 | 19 |
Power Bi Relation Ship
Solved! Go to Solution.
Hey @Samiozt ,
So the only way I can see this working is if you merge together Person and Data together into the Data table.
Expand to include GRUP, PERSON, and SHARE.
Then create a custom called RESULT by multiplying UNITS REPORT * SHARE
Then add in the RESULT column
Proud to be a Super User!
Hi @Samiozt,
So you have two tables that have a key with duplicate values. So, you need a joining table between them that has all unique values from each table in one column. To do this first go into Power Query (Transform Data) Highlight Territories then Right click on one of the tables and select Add as New Query. Do this to both tables.
Now you have two lists called Territories and Territories (2).
On each list click on it then go to Transform then To Table. There will be a popups asking about delimiters we can just click ok. Now, we have two (2) tables.
On the Territories table click append queries (if you do the drop-down then click Append Queries and not Append Queries as New).
Select the Territories (2) table.
Now we have all the values in one table and one column.
Click Remove Rows then Remove Duplicates.
This gives a unique list of values.
Right click on Territories (2) and uncheck the Enable Load option.
On the Territories table rename the column to TERRITORIES and change the data type to text. Click Close and Apply.
On the Model screen you will likely see that Power BI has joined the three tables together. If not then join Data to Territories and Territories to Person.
Change the Cross filter direction of the Person to Territories join to Both.
Create your Matrix the same way you created it originally except this time use the Territories from the Territories table.
This should give you the results you are looking for.
Hope this helps and if you're looking for a different result then let me know what result you're looking for.
Proud to be a Super User!
Hello @Watsky, thank you for the reply. I am sending the desired result as excel. (Expected Values).
Power Bi result The area I marked as red is wrong.
I'm having trouble as my issue is multiplying Shares by sums in these top totals.
Hello again everyone;
You can see the excel and pbix link where it reaches the correct result.
Hope you can help.
Hey @Samiozt ,
So the only way I can see this working is if you merge together Person and Data together into the Data table.
Expand to include GRUP, PERSON, and SHARE.
Then create a custom called RESULT by multiplying UNITS REPORT * SHARE
Then add in the RESULT column
Proud to be a Super User!
It worked thank you very much. 🙏👍
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
91 | |
84 | |
76 | |
65 |
User | Count |
---|---|
145 | |
109 | |
109 | |
102 | |
96 |