Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Good morning.
I have 2 tables (sales table and costs table) related by a year-month concatenation. I can't bring all the data in the cost table to the sales table. Let me explain myself by examples:
I have 2 tables, one of sales and one of costs:
| Sales table | |||
| year | my | sales | AA sales |
| 2022 | 1 | 100 | 75 |
| 2022 | 2 | 200 | 175 |
| 2023 | 3 | 300 | 350 |
| Cost table | ||
| year | my | cost |
| 2022 | 1 | 50 |
| 2022 | 2 | 125 |
| 2022 | 3 | 180 |
| 2021 | 1 | 30 |
| 2021 | 2 | 95 |
| 2021 | 3 | 150 |
I have related both tables using a column in which there is a year-month concatenation formula.
I have managed to bring to the sales table the data of the cost table referring to the year 2022, but not those of 2021.
| year | my | sales | AA sales | cost | AA cost |
| 2022 | 1 | 100 | 75 | 50 | |
| 2022 | 2 | 200 | 175 | 125 | |
| 2023 | 3 | 300 | 350 | 180 |
|
My goal is to also be able to bring the cost data for 2021, so that the final table is like this:
| year | my | sales | AA sales | cost | AA cost |
| 2022 | 1 | 100 | 75 | 50 | 30 |
| 2022 | 2 | 200 | 175 | 125 | 95 |
| 2023 | 3 | 300 | 350 | 180 | 150 |
How can I get this table? I could solve it by making a copy of the cost table and leaving the original cost table with the 2022 data and the new table with the 2021 costs and relating both tables to the sales table, but it seems impractical to me.
Thank you
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |