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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Syndicate_Admin
Administrator
Administrator

Help to create a stacked column chart with an unconventional size

Hello good afternoon, as I put it in the title I have to create a stacked column chart that I look like it looks like this.

GerardCon_0-1734490425139.png

The complexity I find in doing so has to do with the way in which the measurement that the calculation has to take has to be made.

The data with which the calculation is made arrives as follows:

GerardCon_1-1734490662741.png

Three measures are evaluated, one for treated water, one for potable water and one for packaged water, these columns can have three values, "Meets Requirements", "Does Not Meet Requirements" and blank, if all the records that are being filtered are blank or "Meets Requirements" the final result must be "Meets Requirements", if there is a single record with a value "Does Not Meet Requirements" the final result must be "Does Not Meet Requirements", however, for the representation in the graph what is expected is to show the count of the number of "Plants" that meet ("Meets Requirements") or that do not meet "Does Not Meet Requirements", coloring green those that meet and red those that do not.

The graph should show "Potable water", "Packaged water" and "Treated water" in a different bar, remembering that it is required to be a stacked graph.

The measurements that have been made to make the calculations are of this type:

GerardCon_2-1734491151715.png

GerardCon_3-1734491177605.png

The question I have is how to configure the stacked column chart meeting these conditions.

One thing I had tried to do was create a second view where I transposed the data as follows.

GerardCon_4-1734491394627.png

and create the following measurement

GerardCon_5-1734491432372.png

And this worked partially for me if I set the graph like this

GerardCon_6-1734491477258.png

But if I set it like this in the green part it counts all the plants without excluding those that result in "Does Not Meet Requirements"

GerardCon_8-1734491569175.png

In that example, only the red part should appear, not the green part, since only a plant that does not comply is being filtered.

In whatever way you can help me, I will thank you.

Best regards.

1 ACCEPTED SOLUTION
v-priyankata
Community Support
Community Support

Hi @Syndicate_Admin ,
We are grateful for your participation in the Microsoft Fabric Community forum.

While some aspects were a bit unclear, I’ve done my best to provide suggestions based on my interpretation of your requirements.

  • Combine the three columns (Treated Water Compliance, Packaged Water Compliance, and Potable Water Compliance) into a single column named Compliance Category, as shown below
  • Based on your requirement, blank values are considered equivalent to "Meets Requirements." So, I have replaced the blank values, accordingly, as shown below.

vpriyankata_0-1735040392587.png

 

 

  • Create individual measures for 3 categories

 

Packaged Water Compliance =

IF(

    COUNTROWS(FILTER('water', 'water'[Compliance Category] = "Packaged Water Compliance" && 'water'[Compliance Status] = "Does Not Meet Requirements")) > 0,

    "Does Not Meet Requirements",

    "Meets Requirements"

)

 

-------------------------------------------------------------------------------------------------------------------

Potable Water Compliance =

IF(

    COUNTROWS(FILTER('water', 'water'[Compliance Category] = "Potable Water Compliance" && 'water'[Compliance Status] = "Does Not Meet Requirements")) > 0,

    "Does Not Meet Requirements",

    "Meets Requirements"

)

 

-------------------------------------------------------------------------------------------------------------------

Treated Water Compliance =

IF(

    COUNTROWS(FILTER('water', 'water'[Compliance Category] = "Treated Water Compliance" && 'water'[Compliance Status] = "Does Not Meet Requirements")) > 0,

    "Does Not Meet Requirements",

    "Meets Requirements"

)

 

-------------------------------------------------------------------------------------------------------------------

  • Then create the measures for plants that meet & plants that do not meet.

 

Plants That Meet =

COUNTROWS(

    FILTER('water', 'water'[Compliance Status] = "Meets Requirements")

)

-------------------------------------------------------------------------------------------------------------------

Plants That Do Not Meet =

COUNTROWS(

    FILTER('water', 'water'[Compliance Status] = "Does Not Meet Requirements")

)

 

-------------------------------------------------------------------------------------------------------------------

  • Now, create a stacked chart and drag the Compliance Category field to the Y-axis and the fields for Plants That Meet and Plants That Do Not Meet to the X-axis.
  • In the Format Pane, enable Data Labels and Total Data Labels. Under the Columns option, set the colors to distinguish between Plants That Meet (e.g., green) and Plants That Do Not Meet (e.g., red).

 

vpriyankata_1-1735040392599.png

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.


Thanks,
Priyanka.

CST community member.

View solution in original post

5 REPLIES 5
v-priyankata
Community Support
Community Support

Hi @Syndicate_Admin 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-priyankata
Community Support
Community Support

Hi @Syndicate_Admin , Just checking in as we haven’t received an update from you regarding last response. Were you able to resolve the issue?

If solution was helpful, please mark it as Accept Answer and click Yes to confirm.

Feel free to let us know if you have any further questions—we’re here to help!

Thank you for being a part of the Microsoft Fabric Community Forum!

v-priyankata
Community Support
Community Support

Hi @Syndicate_Admin ,
We are grateful for your participation in the Microsoft Fabric Community forum.

While some aspects were a bit unclear, I’ve done my best to provide suggestions based on my interpretation of your requirements.

  • Combine the three columns (Treated Water Compliance, Packaged Water Compliance, and Potable Water Compliance) into a single column named Compliance Category, as shown below
  • Based on your requirement, blank values are considered equivalent to "Meets Requirements." So, I have replaced the blank values, accordingly, as shown below.

vpriyankata_0-1735040392587.png

 

 

  • Create individual measures for 3 categories

 

Packaged Water Compliance =

IF(

    COUNTROWS(FILTER('water', 'water'[Compliance Category] = "Packaged Water Compliance" && 'water'[Compliance Status] = "Does Not Meet Requirements")) > 0,

    "Does Not Meet Requirements",

    "Meets Requirements"

)

 

-------------------------------------------------------------------------------------------------------------------

Potable Water Compliance =

IF(

    COUNTROWS(FILTER('water', 'water'[Compliance Category] = "Potable Water Compliance" && 'water'[Compliance Status] = "Does Not Meet Requirements")) > 0,

    "Does Not Meet Requirements",

    "Meets Requirements"

)

 

-------------------------------------------------------------------------------------------------------------------

Treated Water Compliance =

IF(

    COUNTROWS(FILTER('water', 'water'[Compliance Category] = "Treated Water Compliance" && 'water'[Compliance Status] = "Does Not Meet Requirements")) > 0,

    "Does Not Meet Requirements",

    "Meets Requirements"

)

 

-------------------------------------------------------------------------------------------------------------------

  • Then create the measures for plants that meet & plants that do not meet.

 

Plants That Meet =

COUNTROWS(

    FILTER('water', 'water'[Compliance Status] = "Meets Requirements")

)

-------------------------------------------------------------------------------------------------------------------

Plants That Do Not Meet =

COUNTROWS(

    FILTER('water', 'water'[Compliance Status] = "Does Not Meet Requirements")

)

 

-------------------------------------------------------------------------------------------------------------------

  • Now, create a stacked chart and drag the Compliance Category field to the Y-axis and the fields for Plants That Meet and Plants That Do Not Meet to the X-axis.
  • In the Format Pane, enable Data Labels and Total Data Labels. Under the Columns option, set the colors to distinguish between Plants That Meet (e.g., green) and Plants That Do Not Meet (e.g., red).

 

vpriyankata_1-1735040392599.png

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.


Thanks,
Priyanka.

CST community member.

Hi @Syndicate_Admin , Just checking in as we haven’t received an update from you regarding last response. Were you able to resolve the issue?

If solution was helpful, please mark it as Accept Answer and click Yes to confirm.

Feel free to let us know if you have any further questions—we’re here to help!

Thank you for being a part of the Microsoft Fabric Community Forum!

Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors