Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
hidzirf
Helper I
Helper I

Create Stacked column chart

Dear All PBI Experts,

 

I have the table example as below:

TaskValue
Ind123FALSE
Ind345TRUE
Ind567FALSE
Ind789TRUE
Fam123FALSE
Fam345TRUE
Fam567  FALSE
Fam789TRUE

 

I would like to create a stacked column chart to shows the different task values for Ind and Fam. How is this possible?

 

Thank you.

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @hidzirf ,

 

Create a column with below code:-

Column =
IF ( CONTAINSSTRING ( [Task], "Ind" ), "Ind", "Fam" )

 

Now create two measures like below:-

_true =
COUNTROWS ( FILTER ( 'Table', 'Table'[Value] = TRUE () ) )
_false =
COUNTROWS ( FILTER ( 'Table', 'Table'[Value] = FALSE () ) )

 

Output:-

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

6 REPLIES 6
Samarth_18
Community Champion
Community Champion

Hi @hidzirf ,

 

Create a column with below code:-

Column =
IF ( CONTAINSSTRING ( [Task], "Ind" ), "Ind", "Fam" )

 

Now create two measures like below:-

_true =
COUNTROWS ( FILTER ( 'Table', 'Table'[Value] = TRUE () ) )
_false =
COUNTROWS ( FILTER ( 'Table', 'Table'[Value] = FALSE () ) )

 

Output:-

image.png

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Dear Samarth,

 

I have tried and this has resolved my problem.

Thank you so much for your help.

VijayP
Super User
Super User

@hidzirf 
You can create two measures
calculate(count(Value), filter(tablename, value = "True")
calculate(count(Value), filter(tablename, value = "false")
and use these measures in the Values in Stacked bar chart and you will get the required result!





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Hi VijayP,

 

Thank you for the guidance but unfortunately, the result come out not as what I'm required. I need to group "Ind" and "Fam" separately. The bar chart should show that the "Ind" count of value is 4 with 2 false and 2 true, same goes with "Fam".

 

Appreciate it if there is any better solution for this?Thank you.

VijayP
Super User
Super User

@hidzirf 
Do you wish to show the count of true and False separately? What should be the outcome look like?




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Hi VijayP,

 

Thank you for your reply. Yes, I would like to count the True and False separately for each type of task. The outcome will show like this:

 

hidzirf_0-1645596269339.png

 

 

Thank you.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.