Forum Discussion
Add Multiple Values in Column per ID
- 5 years ago
Kureigu it will be easier to do in PQ, merge your ID table with the 2nd table which has the year on the ID column, and after the merge step, expand the column you just created and you will get all the years for each ID.
Something like this:
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- 5 years ago
Hello Kureigu ,
Create an additional column and do cross join.
Refer the pbix file on below link
https://dropfiles.org/rEba7WTm
Regards
sanalytics
If it is your solution then please like and accept it as your solution
Kureigu it will be easier to do in PQ, merge your ID table with the 2nd table which has the year on the ID column, and after the merge step, expand the column you just created and you will get all the years for each ID.
Something like this:
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Hello parry2k
Great solution. I was attempting somethjing similar with my example data set:
Table 1:
| Product ID | Lifespan (Years) | Activation year | Purchase value |
| 400 | 50 | 2011 | £500 |
| 401 | 50 | 1975 | £10,000 |
| 402 | 50 | 1950 | £12,000 |
| 403 | 30 | 2010 | £50,000 |
| 404 | 40 | 2020 | £40,000 |
Table 2:
| Year |
| 1970 |
| 1971 |
| 1972 |
| 1973 |
| 1974 |
| 1975 |
| 1976 |
| 1977 |
| 1978 |
| 1979 |
| 1980 |
| 1981 |
| 1982 |
| 1983 |
| 1984 |
| 1985 |
| 1986 |
But there is no ID against the Year column in table 2. So how can I create the merge with the ID relationship. I need the exact same output in your solution buit can't do it without the ID key to connect the two.
Hoppe that makes sense.
S