Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Transpose Table in DAX

Hello guys i have an issue,

i have a calculated table like this where the values are measures in a another table called "Records"

ABC
234356

 

created using this DAX Expression

 

SELECTCOLUMNS(
    ADDCOLUMNS('Records',
     "A", [Measure A],
      "B", [Measure B],
      "C", [Measure C],
     ),
     "A",[A],
     "B", [B],
     "C", [C]
    )

 

 

I want to transpose it so it looks líke this.

MeasureValue
A23
B43
C56

 

 

Or is there a way i can achieve this structure without having to use the DAX Expression above.
Please help.
Thank you

GuyInACube

  • Hi Anonymous 

    UNION (
        ROW ( "Measure", "A", "Value", [Measure A] ),
        ROW ( "Measure", "B", "Value", [Measure B] ),
        ROW ( "Measure", "C", "Value", [Measure C] )
    )
    

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

3 Replies

  • AlB's avatar
    AlB
    Community Champion

    Hi Anonymous 

    UNION (
        ROW ( "Measure", "A", "Value", [Measure A] ),
        ROW ( "Measure", "B", "Value", [Measure B] ),
        ROW ( "Measure", "C", "Value", [Measure C] )
    )
    

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Oh My God, Thank you,

      This worked like a dream.

      I am so embarassed at how easy the solution was.

       

      Again Thank you.

    • ValerieR's avatar
      ValerieR
      New Member

      Perfect!  This option worked great for me! It's simple and to-the-point!  I needed a table of Measure values and this option did the trick!  The table I needed looked this:

      <code>

      CurrentProgramProgress =
      UNION (
          ROW ("Asset","REL","Current Progress",[RELActProjectProgress]),
          ROW ("Asset","Effort","Current Progress",[EffortActProjectProgress]),
          ROW ("Asset", "Station 515", "Current Progress", [Station515WeeklyProgress]),
          ROW ("Asset", "Station 201", "Current Progress", [Station201WeeklyProgress]),
          ROW ("Asset", "Station 505", "Current Progress", [Station505WeeklyProgress]),
          ROW ("Asset", "Comp Stn Mods", "Current Progress", [CompStnModsActOverallProgress]),
          ROW ("Asset", "Mt Laurel", "Current Progress", [MtLaurelActOverallProgress]),
          ROW ("Asset", "Lawnside", "Current Progress", [LawnsideActOtherProgress]),
          ROW ("Asset", "Camden", "Current Progress", [CamdenActOverallProgress]),
          ROW ("Asset", "Mainline A Regulator", "Current Progress", [MainlineAActOverallProgress]),
          ROW ("Asset", "Delaware River Regulator", "Current Progress", [DelawareActOverallProgress]),
          ROW ("Asset", "Beaver Dam", "Current Progress", [BeaverDamActOverallProgress])
      )
      </code>
      And the resulting table looked like this:

      It's perfect and just what I needed!  Thank you!