Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Auto UnPivot based on the column name

Hi Can someone help me out here, 
i have a scenario where input xlsx has few columns that should be auto unpivoted in the PBI Desktop and get the desired output based on the screenshot. 
Which means if MML 07 Hrs & MML 07 $ is added as new column it should automatically get unpivoted and fall in MML, Hrs, $ like the output.

InputFile:

 

 

 

OutputFile (in PBIX)

  • Hey Anonymous ,

     

    this should be possible in Power Query by selecting the first 2 columns, then do a right-click and chose "Unpivot Other Columns":

     

    Let me know if that works for you.

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

     

2 Replies

  • selimovd's avatar
    selimovd
    Icon for Most Valuable Professional rankMost Valuable Professional

    Hey Anonymous ,

     

    this should be possible in Power Query by selecting the first 2 columns, then do a right-click and chose "Unpivot Other Columns":

     

    Let me know if that works for you.

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for quick reply selimovd but this is giving me like the below screenshot then how can i seperate Hrs & $ and do a re-pivot like how it should be in output.