Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
I'm trying to figure out how to display data in a particular way and can't figure out the combo of measures and options to get it done. This would be a similar example of what I have:
Colors |
Blue |
Green, Red |
Red, Blue |
Yellow |
Red |
Blue, Yellow, Red |
What I'd like to do is display a column chart that counts how many cells contain a particular color. So along the x-axis it would have Blue (value of 3), Green (value of 1), Red (value of 4), Yellow (Value of 2).
If I just do the simplest thing and create a column chart with Colors on the x-axis and "count of colors" on the y-axis, it creates 6 different columns 1 high of "Blue"; "Green, Red"; "Red, Blue"; etc.
I've tried creating another data table that just lists the individual colors, set a relationship back to the original column, and then set the individual colors along the axis. That successfully filters to just the individual colors, "Blue", "Green", "Red", and "Yellow", but it only counts the unqiue occurrences when it is the only color listed. So "Blue" displays as 1 because it counts "Blue", but not "Red, Blue" or "Blue, Yellow, Red".
Alternatively, I've created new calculated columns in the data table that does a search for each term and can let me sum that column to get the accurate numbers ... but then I don't know what to put on the X-Axis.
At this point I'm so far deep in the rabbit hole I can't see the forrest for the trees. Don't know what to try next. Any suggestions?
Thanks!
Solved! Go to Solution.
Hi,
In the Query Editor, split the column by rows.
Hi,
In the Query Editor, split the column by rows.
Thanks Ashish! This did ultimately get me to what I wanted to do.
I was so focused on using a measure or counter or something with filters that I didn't think to create a new table just for this specific purpose. I have other columns and functions on my data where I couldn't create new rows without it messing up other calculations. However, using the same source data I create a new table just to get the color counts.
Created a new table from the same source document, removed the columns I wouldn't need, split the "Colors" column with the comma delimiter into new rows, and then I could do counts and match things up just fine. I created a relationship back to the third table that just has the list of colors with a one-to-many relationship that I can put along the X-axis and now I'm golden. It's doing the calculations right and helping me digest the data in a way I want to see it.
Thanks again!
You are welcome.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
94 | |
90 | |
35 | |
35 |
User | Count |
---|---|
154 | |
100 | |
82 | |
63 | |
53 |