Forum Discussion

tgordon's avatar
tgordon
New Member
6 years ago
Solved

Transpose data from calculated columns

I have a set of data organized as shown below:

 

ProjectQuarter for RevenueY1 RevenueY2 Revenue2020 Q12020 Q22020 Q32020 Q42021 Q12021 Q22021 Q32021 Q4
Project A2020 Q3507500505050507575
Project B2020 Q125602525252560606060
Project C2021 Q2103000000101010
Project D2021 Q3100200000000100100


The "YYYY Q#" columns are calculated from the other columns.  I would like to create a new table that looks like below:

QuarterProject AProject BProject CProject D
2020 Q102500
2020 Q202500
2020 Q3502500
2020 Q4502500
2021 Q1506000
2021 Q25060100
2021 Q3756010100
2021 Q4756010100

 

Is there a way to do this in power bi?  I found that you can do it with power query, but that doesn't work on calculated columns. I want to plot quarter vs revenue by project and this is the only way I found to make it work.

 

Thanks for your help!

  • Hi tgordon 

    you could create a custom column in Power Query. it could be the same as your calculated column (but it depends on your data model). after that - pivot/unpivot functions in power query

    do not hesitate to give a kudo to useful posts and mark solutions as solution

3 Replies

  • az38's avatar
    az38
    Community Champion

    Hi tgordon 

    you could create a custom column in Power Query. it could be the same as your calculated column (but it depends on your data model). after that - pivot/unpivot functions in power query

    do not hesitate to give a kudo to useful posts and mark solutions as solution

  • Anonymous's avatar
    Anonymous
    Not applicable

    tgordon 

    It is recommended to create a custom column, and then shape the data using some unpiviot, remove and transpose in Power Query.

     

    Best,
    Paul

  • tgordon it will be easy to provide a solution if you share how does your raw data looks like and there is potential solution looking at it.