Forum Discussion
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).
can anyone help in this please?
2 Replies
- AnonymousNot applicable
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 ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- CodeDrivenNew 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:
Disable Sentimental Coloring
- Turn off any default coloring options to ensure your custom colors are applied correctly.
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 ) )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!