Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello community members,
I'm still a newbie with PowerQuery and PowerBI and learning a lot from your valuable solutions.
Maybe you can help me with the following:
In a PowerBI query I have the following situation in a table:
Categories | Values per category | ...<other data> | ...<even more data> |
10,12,13,14,29 | 0,1,10,5,4 | ||
10,11,12,13,19,14,15,17,18,23 | 0,0,30,40,0,30,40,80,50,25 |
I have a second query that gives me the categories by id and name:
id | Name |
10 | Category A |
11 | Category B |
12 | Category C |
13 | Category D |
14 | Category E |
15 | Category 100 |
16 | Category 120 |
17 | Category F |
19 | Category G |
23 | Category H |
29 | Category Z |
What I want:
In my first table, I want to "decode" the category ids from column "Categories" to single columns with the category names from my second query and to fill the values per category in the corresponding columns. I don't want to have lines per value with all other cloumns repeated per line, but the columns as shown in the example:
Categories | Values per category | Category A | Category B | Category C | Category D | ... | <other data> | <even more data> | |
10,12,13,14,29 | 0,1,0,5,4 | 0 | 1 | 10 | ... | ||||
10,11,12,13,19,14,15,17,18,23 | 0,0,30,40,0,30,40,80,50,25 | 0 | 0 | 30 | 40 | ... | |||
Any help is highly appreciated.
Solved! Go to Solution.
Hi @fraggl ,
You can first get the following table by some steps.
Then use merge queries and pivot column to get the final result.
You can download my attachment for more details.
You can view the details in the applied steps.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @fraggl ,
You can first get the following table by some steps.
Then use merge queries and pivot column to get the final result.
You can download my attachment for more details.
You can view the details in the applied steps.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
9 | |
8 | |
6 | |
6 | |
6 |