Forum Discussion
Combining two columns into one
HI!
I have a question (maybe a newby one)
I have a table that has Drivers (1-9 code, which is defined in a separate table) and Variance which is Decimal value.
These comes from 2024-2029 years. The problem is that they are in separate columns, and where Driver has a value, the Variance is empty.
I want to see each "Variance" value next to each driver row, year by year.
I hope it is clear.
Thanks
4 Replies
- ryan_mayuSuper User
could you pls paste the sample data (not the screenshot) and also provide the expected output in the table.
- DinkaDankaRegular Visitor
The table itself looks like this:
ID Driver*2024*FY Driver*2025*FY Driver*2026*FY Driver*2027*FY Driver*2028*FY Driver*2029*FY Rev (@25BUD USD)*2024*Total Rev (@25BUD USD)*2025*Total Rev (@25BUD USD)*2026*Total Rev (@25BUD USD)*2027*Total Rev (@25BUD USD)*2028*Total Rev (@25BUD USD)*2029*Total Variance*2025*Variance Variance*2026*Variance Variance*2027*Variance Variance*2028*Variance Variance*2029*Variance 1 0 0 0 0 0 0 2 566 815 125 2 566 815 125 2 566 815 125 2 566 815 125 2 566 815 125 2 566 815 125 - - - - - 2 0 0 0 0 0 0 4 876 948 139 4 876 948 139 4 876 948 139 4 876 948 139 4 876 948 139 4 876 948 139 - - - - - 3 0 9 0 0 0 0 4 206 359 626 415 641 881 415 641 881 415 641 881 415 641 881 415 641 881 - 4 994 081 567 - - - - And the expected outcome should look something like this:
(Variance is basically yoy change, calculated in excel)
I want to do some kind of waterfall in Powerbi which shows how revenue changes from year to year, driven by which driver.
ID Year Driver Rev Variance 1 2024 1 100 100 1 2025 2 120 20 1 2026 0 120 0 1 2027 0 120 0 1 2028 0 120 0 2 2024 1 100 100 2 2025 2 120 20 2 2026 0 120 0 2 2027 0 120 0 2 2028 0 120 0 Thank you very much
D
- AnonymousNot applicable
Hi All,
Fisrtly ryan_mayu thank you for your solution!
And DinkaDanka to my understanding, you need to transform the data to be arranged by rows in what was originally multi-column year data, and each of them has to be correctly related. Since pivoting the data will result in different Year columns, we need to aggregate the different columns to get the correct correlation, so we can organise your data into three tables and then aggregate them at the end.
After the Unpivot, then our ID column is used in the Year column for the merge, and the three tables are merged to get the correct relationship, I hope this helps!If you have any other questions, check out the PBIX file I uploaded and I would be honoured if I could solve your problem!
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi DinkaDanka ,
Has your problem been solved after all this time, or has a new problem arisen, if there are any other questions on this issue, feel free to contact me and I'll get back to you as soon as I receive the message.
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.