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
Hi Team
I have two tables that I need to combine based on a year criteria.
Table 1 shows the number or items sold during certain year, and the Table 2 is the database created after 2019 that contains the list of items sold sice 2019.
Table 1
| Year | Number |
| 2016 | 5 |
| 2017 | 8 |
| 2018 | 10 |
Table 2
| Date | Ref |
| 12/May/2019 | 10 |
| 13/Apr/2019 | 11 |
| 1/Oct/2019 | 10 |
| 8/Jun/2020 | 1 |
| 10/Jan/2021 | 07 |
| 10/Jun/2021 | 10 |
I need to create a table that will fetch the data in the column Number from the table 1 for the years 2016 to 2018 and for 2019 and forward the sum of the number of items sold during those years.
Result
| Year | # Articles sold |
| 2016 | 5 |
| 2017 | 8 |
| 2018 | 10 |
| 2019 | 3 |
| 2020 | 1 |
| 2021 | 2 |
Thanks a lot for your help
Solved! Go to Solution.
Hi,
This is my solution :
1- In Table 2 I create the Year column based on the date column in Power Query :
2- Append 2 tables and delete :
3- Create the below measure in new table :
Thanks for Kudos and please mark it as solution if it helps
Hi,
This is my solution :
1- In Table 2 I create the Year column based on the date column in Power Query :
2- Append 2 tables and delete :
3- Create the below measure in new table :
Thanks for Kudos and please mark it as solution if it helps
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |