Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
I'm having issue creating a very simple chart and would appreciate some help.
My data looks like this:
Order # Region State Apple Banana Orange Grape Pineapple
A-001 South LA x x x x x
A-002 East NY x x x
I would like to create a bar chart like the one below, with Region and State as slicers. And I can't seem to create this simple chart. Any help is greatly appreciated.
Sample file: https://drive.google.com/file/d/1aFz-bNYsWiNQ4yFhN6N6Uc7rqiOEqBFH/view?usp=sharing
Solved! Go to Solution.
In the query editor, select the order, region, and state columns the go to transform > unpivot > unpivot other columns:
Then select the Value column and remove blanks, leave only the X's
Rename Attribute to Fruit and click close and apply.
Then you can add the fruit column to the axis and a simple measure to count the rows of the table to get your count by fruit.
I have attached my sample .pbix for you to look at.
In the query editor, select the order, region, and state columns the go to transform > unpivot > unpivot other columns:
Then select the Value column and remove blanks, leave only the X's
Rename Attribute to Fruit and click close and apply.
Then you can add the fruit column to the axis and a simple measure to count the rows of the table to get your count by fruit.
I have attached my sample .pbix for you to look at.
Worked beautifully in Import mode. Thank you!
Out of curiosity, is there a similar function if using Live Connection to a SSAS tabular cube?
You don't have the transform options when connecting to a SSAS model but you could transform the data before feeding it into SSAS using a UNION in a SQL view that would replicate the unpivot.
I'll give UNION a try. At least now I have a back-up plan if that doesn't work out.
Thank you again. Appreciated.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |