Forum Discussion

AGo's avatar
AGo
Post Patron
9 years ago
Solved

Unpivot calculated columns

Is it possible to unpivot some calculated columns with one of the Power BI Desktop tools or using DAX? I have 8 calculated columns titled with the type of the event valued with date format.

  • Hi AGo,

     

    In PowerBI desktop, we can only unpivot table in Query Edit. It is not allowed to use DAX to change the table structure. And as you know, calculated columns will not display in Query edit, so your requirement cannot be achieved currently.

     

    Thanks,
    Yuliana Gu

3 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Microsoft Employee

    Hi AGo,

     

    In PowerBI desktop, we can only unpivot table in Query Edit. It is not allowed to use DAX to change the table structure. And as you know, calculated columns will not display in Query edit, so your requirement cannot be achieved currently.

     

    Thanks,
    Yuliana Gu

    • omrdmr's avatar
      omrdmr
      Helper I

      Hi v-yulgu-msft

       

      Is this limitation still in force? Have there been any changes since Sep'16?

       

      I have a hierarchy table which has columns for levels up to 20; created using path function in DAX. I need to get every node associated with a different table. To my knowledge, this is only possible by unpivoting columns to have only 2 columns; parents and all linked children. As the hierarchy is identified in DAX, the rest must be done using DAX as well.

       

      An example of the desired output based on the given hierarchy table:

       

      Hierarchy table created with the help of DAX  PATH function 

       
      Level1Level2Level3Level4
      ABCD
      ABCF
      ABG 
      AH  

       

       

      Desired Output:
      ParentsChildren  
      AB  
      AC  
      AD  
      AF  
      AG  
      AH  
      BC  
      BD  
      BF  
      BG  
      CD  
      CF  
    • ronil_shah's avatar
      ronil_shah
      Regular Visitor

      Is there any other way to do this please?