Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
i want to merge 2 Tables.
The Tables have the following structures:
Table A
Date Account No Account Level1 Level2 Amount
1.1.17 4100 Bla 1 Revenue Internal 100
5.2.17 4300 Bla 2 Revenue External 150
10.3.17 5700 Bla 3 Personal Workers -300
17.4.17 6300 Bla 4 Fixed C. Energy -200
Table B
Date Account No Account Level 1 Level 2 Amount Budget
31.1.17 Internal 110
28.2.17 External 160
31.3.17 Workers -350
30.4.17 Energy -120
I want to add the Budget for each Level 2 and Month to Table A.
I also tried to make a separate Table and create a Budget_ID with Month&Year&Level2 in both tables, but if there was no Amount in Level2 there would be no Budget too and if there are more than 1 etries in Level2 within a month, then i would get the Budget multiple times....
Hopefully you get my issue.
Solved! Go to Solution.
it turned out, that it was easier than I thought.
I didn't know that by appending queries I can also add columns. So the solution to my probelm was just to append Table B to Table A.
it turned out, that it was easier than I thought.
I didn't know that by appending queries I can also add columns. So the solution to my probelm was just to append Table B to Table A.
Hi @herbemischung,
Write the following calculated column formula in TableA
=LOOKUPVALUE(TableB[Budget],TableB[Level 2],[Level2],TableB[Date],EOMONTH([Date,0))
Hope this helps.
Hi @herbemischung,
To add the Budget for each Level 2 and Month to Table A, you can create a calculated column in Table A:
Budget = LOOKUPVALUE('Table B'[Budget],'Table B'[Level 2],'Table A'[Level2])
For your second question, can you show the desired results based on the sample data you provided?
Best Regards,
Qiuyun Yu
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |