Forum Discussion
stacked chart
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
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-measureOnes = 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 🙂
12 Replies
- FowmySuper User
Minakshi
Add an Index column and Unppivot your data then add two-measureOnes = 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 🙂
- MinakshiResolver I
- FowmySuper User
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 🙂
- FowmySuper User
- Pragati11Super User