Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi guys,
I need to add another stacked bar showing the total of the 2 countries added up. Is there a way to do this without writing a measure?
Thank you
Solved! Go to Solution.
Hi @Anonymous
You need to create a calculated table to add the new row [Total] .
(1)Create a calculated table .
Table 2 = UNION(VALUES('Table'[Country]),ROW("Country","Total"))
(2)Calculate the sum of value grouped by Country .
Measure 1 =
var s = SELECTEDVALUE ( 'Table 2'[Country] )
var t=CALCULATE(SUM('Table'[Value]),'Table'[Country]=s)
RETURN IF (s = "Total",SUM ( 'Table'[Value] ),t)
(3)Add a Stacked Column chart ,put Table 2 [Country] in Axis , Table [Category] in Legend , Table 2 [Measure 1] in Values .
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
@Anonymous ,
Based on Ailsa's solution, I think you need to change your Var t to:
VAR t = CALCULATE(SUM(Data[Revenue (Base)]), 'Data'[Country] = s)See if that works for you.
Regards,
Hi @Anonymous
You need to create a calculated table to add the new row [Total] .
(1)Create a calculated table .
Table 2 = UNION(VALUES('Table'[Country]),ROW("Country","Total"))
(2)Calculate the sum of value grouped by Country .
Measure 1 =
var s = SELECTEDVALUE ( 'Table 2'[Country] )
var t=CALCULATE(SUM('Table'[Value]),'Table'[Country]=s)
RETURN IF (s = "Total",SUM ( 'Table'[Value] ),t)
(3)Add a Stacked Column chart ,put Table 2 [Country] in Axis , Table [Category] in Legend , Table 2 [Measure 1] in Values .
The final result is as shown :
I have attached my pbix file , you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
I have followed the steps
Step 1: Create Customized Table
Step 2: Create Dax Measure
Measure 3 =
VAR s = SELECTEDVALUE('Grand Total Fix'[Country] )
VAR t = CALCULATE(SUM(Data[Revenue (Base)]), 'Grand Total Fix'[Country] = s)
RETURN IF (s = "Total", SUM(Data[Revenue (Base)]),t)
Step 3:Results ( Adding total works, however there are still duplicates)
Regards
@Anonymous ,
Based on Ailsa's solution, I think you need to change your Var t to:
VAR t = CALCULATE(SUM(Data[Revenue (Base)]), 'Data'[Country] = s)See if that works for you.
Regards,
I have tried following the post,
however im getting duplicate values
@Anonymous , refer this old solution
https://community.powerbi.com/t5/Desktop/Grand-Total-in-Bar-Chart/m-p/612631
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |