Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

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.

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

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

Change Type.PNG

 

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.

 

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

@Nathaniel_C 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
Nathaniel_C
Community Champion
Community Champion

tableFlagtable.PNG

Drop each column into a matrix as follows:

rows.PNG

for this solution.

Ifsolution flag.PNG

this solves your issue, please

mark it as a solution.  Kudos are nice too!

 

@Nathaniel_C 

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

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

Hi @Anonymous ,

 

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

Change Type.PNG

 

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.

 

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

@Nathaniel_C 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

aeriel_0-1674650376795.png

this solution is not working in DirectQuery bro! @Nathaniel_C 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.