The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hey,
So I have an issue in the way parts of the data stored in our database needs to be rearranged.
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.
Solved! Go to Solution.
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")
Best Regards
Sorry for the late reply. You're probably right. I've been trying to make it work, but I cannot get it quite right.
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?
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")
Best Regards
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.
User | Count |
---|---|
83 | |
82 | |
34 | |
33 | |
32 |
User | Count |
---|---|
93 | |
79 | |
62 | |
54 | |
51 |