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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Turning values in a column into column headers sorted by warenumber

Hey, 

So I have an issue in the way parts of the data stored in our database needs to be rearranged. 

 

Sgb1201_0-1658912540489.png

In the above picture, column "type" contains four different values. I would instead like for these to be turned into column headers, where the corresponding values in the "kNummer" column still corresponds with the "Varenummer" column. The same needs to be done for the genartnr (which) is a numerical value. 
To clarify, the genart and genartnr are values that can appear twice (or more) for the "Varenummer" column, which means that in some cases the "Varenummer" value appears twice, which is a problem. 

Is this easier to achieve in Dax or M ? 

Apologies for any confusion, and please ask/reply if more info is needed etc.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

How did you pivot the column [Type] in Power Query Editor? Could you please provide the related applied codes in Advanced Editor? Thank you.

In addition, you can apply the below code in your Advanced Editor to achieve it.

= Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Type]), "Type", "kNummer")

yingyinr_2-1659422392592.png

yingyinr_0-1659422278066.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Sorry for the late reply. You're probably right. I've been trying to make it work, but I cannot get it quite right. 

Sgb1201_0-1659283670469.png


In the above we have the 2 Genart values as columns, which is correct, but instead of 1 / 0 I'd like it to display the value from the (now deleted) kNummer column. Any clues on how to get this to work? 

Anonymous
Not applicable

Hi @Anonymous ,

How did you pivot the column [Type] in Power Query Editor? Could you please provide the related applied codes in Advanced Editor? Thank you.

In addition, you can apply the below code in your Advanced Editor to achieve it.

= Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Type]), "Type", "kNummer")

yingyinr_2-1659422392592.png

yingyinr_0-1659422278066.png

Best Regards

HotChilli
Super User
Super User

Looks like a Pivot in Power Query.  I can't see the exact details from the picture but experiment with that.

Post some data and the desired outcome if you can't get it to work.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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