Forum Discussion

DinkaDanka's avatar
DinkaDanka
Regular Visitor
2 years ago

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

  • could you pls paste the sample data (not the screenshot) and also provide the expected output in the table.

  • DinkaDanka's avatar
    DinkaDanka
    Regular Visitor

    The table itself looks like this:

     

    IDDriver*2024*FYDriver*2025*FYDriver*2026*FYDriver*2027*FYDriver*2028*FYDriver*2029*FYRev (@25BUD USD)*2024*TotalRev (@25BUD USD)*2025*TotalRev (@25BUD USD)*2026*TotalRev (@25BUD USD)*2027*TotalRev (@25BUD USD)*2028*TotalRev (@25BUD USD)*2029*TotalVariance*2025*VarianceVariance*2026*VarianceVariance*2027*VarianceVariance*2028*VarianceVariance*2029*Variance
    1000000         2 566 815 125         2 566 815 125         2 566 815 125         2 566 815 125         2 566 815 125         2 566 815 125                                -                 -                 -                 -                 -  
    2000000         4 876 948 139         4 876 948 139         4 876 948 139         4 876 948 139         4 876 948 139         4 876 948 139                                -                 -                 -                 -                 -  
    3090000         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.

    IDYearDriverRevVariance
    120241100100
    12025212020
    1202601200
    1202701200
    1202801200
    220241100100
    22025212020
    2202601200
    2202701200
    2202801200

     

     

    Thank you very much

    D

    • Anonymous's avatar
      Anonymous
      Not 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 Shen

      If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

       

       

  • Anonymous's avatar
    Anonymous
    Not 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 Shen

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.