March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
So I have a data set that has the following columns:
Number, Status, Priority, Date Originated
Status can be "Working", "Pending", "Incorporated"
Priority can be "Yellow", "Orange", or "Red"
I want to create a Stacked Column Chart.
How can I create a stacked bar that has "Yellow, Orange, Red" with appropriate counts and a seperate bar next to it that only includes the count of entries with the status "Incorporated"?
Something like this:
Currently, right now this is what I have and I am having trouble.
Solved! Go to Solution.
Hi @powerbinoobster ,
As a workaround, you can create a seperate table as follows. I created by entering data.
Then create the following measure, which you can replace and modify it as needed.
Conditional Count =
VAR _incorporated =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Status] = "Incorporated" )
)
VAR _red =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Priority] = "Red" )
)
VAR _orange =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Priority] = "Orange" )
)
VAR _yellow =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Priority] = "Yellow" )
)
RETURN
SWITCH (
SELECTEDVALUE ( 'Table (2)'[Attribute] ),
"Status", _incorporated,
"Priority",
SWITCH (
SELECTEDVALUE ( 'Table (2)'[Value] ),
"Red", _red,
"Orange", _orange,
"Yellow", _yellow
)
)
Sample data:
Expected result:
You can download my attachment for more details.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @powerbinoobster ,
As a workaround, you can create a seperate table as follows. I created by entering data.
Then create the following measure, which you can replace and modify it as needed.
Conditional Count =
VAR _incorporated =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Status] = "Incorporated" )
)
VAR _red =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Priority] = "Red" )
)
VAR _orange =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Priority] = "Orange" )
)
VAR _yellow =
CALCULATE (
COUNT ( 'Table'[ID] ),
FILTER ( ALLSELECTED ( 'Table' ), [Priority] = "Yellow" )
)
RETURN
SWITCH (
SELECTEDVALUE ( 'Table (2)'[Attribute] ),
"Status", _incorporated,
"Priority",
SWITCH (
SELECTEDVALUE ( 'Table (2)'[Value] ),
"Red", _red,
"Orange", _orange,
"Yellow", _yellow
)
)
Sample data:
Expected result:
You can download my attachment for more details.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, this works! But do you know why when selecting mutiple months, the visual does not refect those values? For example, when you selected January and February on the slicer, Januarys data gets applied to February's columns and both become identical.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
90 | |
90 | |
66 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |