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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.