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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
DikshaT
Regular Visitor

Need 'Total' in Bar/Waterfall chart with Dynamic Semantical Color

Hello,

I want to have Grant Total in the Bar/waterfall chart at last of all the values. And I want to set same semantic color setting to the Total also like other fields (Green if quantity measure is +ve and Red if quantity is -Ve).

DikshaT_0-1678796534436.png

can anyone help in this please?

2 REPLIES 2
CodeDriven
New Member

For those of you still looking for a solution:
I found a way to do it using the "Simple Waterfall" visual and applying dynamic formatting to the bar color. 


Scenario:

Imagine you have a date column as the category (e.g., "Dim_Date"[Date]) and a measure ("YourMeasure") as the value.


Steps:

  1. Disable Sentimental Coloring

    • Turn off any default coloring options to ensure your custom colors are applied correctly.
    • CodeDriven_4-1732613810437.png

       

  2. Create a Dynamic Color Measure

    Add a new measure to your report, that checks whether it is a total by using the property of selected Date(s):

    Bar Color = 
    VAR IsTotal = IF(
        HASONEVALUE('Dim_Date'[Date]),
        FALSE(), -- Regular column
        TRUE()   -- Total column
    )
    
    RETURN
    IF(
        IsTotal,
        -- Logic for total column
        IF(
            [YourMeasure] >= 0,
            "#006400", -- Dark green for positive totals
            "#8B0000"  -- Dark red for negative totals
        ),
        -- Logic for individual columns
        IF(
            [YourMeasure] >= 0,
            "#5CE65C", -- Light green for positive values
            "#FF2C2C"  -- Light red for negative values
        )
    )
  3. Apply Dynamic Coloring

    • Go to your chart’s Visual Element > Bar Colors.
    • Select the fx button for data colors.
    • Choose Format by: Field value and select your Bar Color measure.

Final Outcome:

This approach ensures:

  • Total column:
    • Dark green for positive totals.
    • Dark red for negative totals.
  • Regular columns:
    • Light green for positive values.
    • Light red for negative values

Hope this helps! 

v-rzhou-msft
Community Support
Community Support

Hi @DikshaT ,

 

Is your requirement that you want to add total column in bar chart?

Your demand is a good idea, while it is not supported to implement in Power BI currently.
You can vote up this idea for this function : Microsoft Idea (powerbi.com)
Or you can submit a new idea to improve the Power BI.
It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors