Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Pivot in direct Query

Hi All,

 

I am using direct query to get data from database. Below is requriment 

Input Table 

Seq_#NameFlag
1A101
1B102
1C103
2D101
2E102
3F101
3G102
3H103
3I104

 

Output required

Seq_#Flag_101Flag_102Flag_103Flag_104
1ABCNULL
2DENULLNULL
3FGHI

 

can any tell me how write dax expressions to give desired output .

 

Thanks in advance.

  • Hi Anonymous ,

     

    Here is my table in Power Query. The only  thing I did was to change all columns to text.

     

    Select the flag column. Go to the Transform tab, click on Pivot Column, select Name as the Values Column. Go to the advance options and select don't aggregate. You will see the following.

     

    If this solves your issue, please mark this reply as the solution. Kudos are nice too!

    Nathaniel_C 

4 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Community Champion

    table

    Drop each column into a matrix as follows:

    for this solution.

    If

    this solves your issue, please

    mark it as a solution.  Kudos are nice too!

     

    Nathaniel_C 

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      i want the data to be transpose in the table level but not in the visualization level . 

      • Nathaniel_C's avatar
        Nathaniel_C
        Community Champion

        Hi Anonymous ,

         

        Here is my table in Power Query. The only  thing I did was to change all columns to text.

         

        Select the flag column. Go to the Transform tab, click on Pivot Column, select Name as the Values Column. Go to the advance options and select don't aggregate. You will see the following.

         

        If this solves your issue, please mark this reply as the solution. Kudos are nice too!

        Nathaniel_C