The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I wish to create a column chart with 5 separate pieces of data from a dataset.
So, I have Fields named: - Bebidas azucaradas, bebidas no azucaradas, bebidas isotónicas, bebidas energéticas. These 5 fields are the answer to a multichoice question (what kind of non-water beveradges do you drink?).
I wish the column chart to show these as 5 separate columns with a gapin-between. Each column should show the recount of "Yes" and "No" answers. Whenever I try, I amb either getting them stacked on top of one another (using the stacke version), or right next to each other (using the clustered), without the headings/tiles below.
Many thanks,
Adrià
Solved! Go to Solution.
Hi, @adriaXIII
one way of doing this is to unpivot your table, either in the query to the source or in Powerquery/Advanced editor(using the Unpivot Columns-function of the Transform ribbon).
Your table should then look like this
Attribute | Value |
question 1 | si |
question 1 | no |
question 1 | no |
and so on |
The columns can be renamed to e.g. Question and Answer.
Now create two measures:
positive answer = CALCULATE(COUNTROWS(answers);filter(answers;answers[Answer]="Si"))
Negative answer = CALCULATE(COUNTROWS(answers);filter(answers;answers[Answer]="No"))
and add the questions and the measures to a chart like this:
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Hi, @adriaXIII
one way of doing this is to unpivot your table, either in the query to the source or in Powerquery/Advanced editor(using the Unpivot Columns-function of the Transform ribbon).
Your table should then look like this
Attribute | Value |
question 1 | si |
question 1 | no |
question 1 | no |
and so on |
The columns can be renamed to e.g. Question and Answer.
Now create two measures:
positive answer = CALCULATE(COUNTROWS(answers);filter(answers;answers[Answer]="Si"))
Negative answer = CALCULATE(COUNTROWS(answers);filter(answers;answers[Answer]="No"))
and add the questions and the measures to a chart like this:
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
80 | |
74 | |
50 | |
42 |
User | Count |
---|---|
135 | |
120 | |
75 | |
65 | |
64 |