Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello All,
I want to plot stack charts as shown in figure. I have 4 columns having values 0 and 1. I want to stack count of zeros on count of ones. Kindly help.
Thanks
Solved! Go to Solution.
Hi @Minakshi ,
Consider the following Input Data:
Go to Query Editor, Select both the columns and Unpivot columns under Transform tab:
You will end up with the following:
Close and Apply changes and try creating a chart as follows:
Thanks,
Pragati
@Minakshi
Add an Index column and Unppivot your data then add two-measure
Ones = CALCULATE(COUNTROWS('Table'),'Table'[Value]=1)
Zero = CALCULATE(COUNTROWS('Table'),'Table'[Value]=0)
DOWNLOAD the file:
https://1drv.ms/u/s!AmoScH5srsIYgYIiPWtugR6FM5NxLg?e=2Y9TQM
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
refer
https://www.youtube.com/watch?v=aXpgUM-dSmI
https://www.tutorialgateway.org/create-100-stacked-bar-chart-in-power-bi/
@Minakshi
Add an Index column and Unppivot your data then add two-measure
Ones = CALCULATE(COUNTROWS('Table'),'Table'[Value]=1)
Zero = CALCULATE(COUNTROWS('Table'),'Table'[Value]=0)
DOWNLOAD the file:
https://1drv.ms/u/s!AmoScH5srsIYgYIiPWtugR6FM5NxLg?e=2Y9TQM
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Fowmy @Pragati11 Is there any other way to do it? I don't want to unpivot data as I have more visuals to make with the same data.
Hi @Minakshi ,
You can create a Refrence table to your actual table in Query editor and use for this chart (following un-pivot steps) and keep the original table in case you need it.
But if I see unipvoted data should be able to be used for any charts that you are trying to do.
Thanks,
Pragati
@Pragati11 , @Fowmy will slicers work on charts which are coming from refernce query? field of slicer is coming from pivot table.
Thanks
Tou will need to create relationships between the new referenced table or use measures that use this table.
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
The advantage of having your data unpivoted in this way will support you in almost any visuals as it's normalized. better stick to that.
If you really need it your way, then create a reference query in power query and unpivot. You can use for this visual as well as others when necessary
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Minakshi
Please share some sample data in the layout that is supposed to be used for the chart you desire.
________________________
Did I answer your question? Mark this post as a solution, this will help others!.
I accept KUDOS 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Fowmy , @Pragati11 data is just like this
OSA | Plano | location | facing |
0 | 1 | 0 | 1 |
1 | 1 | 0 | 1 |
0 | 1 | 1 | 1 |
1 | 0 | 1 | 1 |
I want to show no of zeros and no of one stacked on each other for each colum.
Thanks
Hi @Minakshi ,
Consider the following Input Data:
Go to Query Editor, Select both the columns and Unpivot columns under Transform tab:
You will end up with the following:
Close and Apply changes and try creating a chart as follows:
Thanks,
Pragati
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |