Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
To get a Total Bar in a clustered column chart.
Need a total bar along with the four bars as shown in the below image.
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous
You can refer to the following example
Sample data
1.Create a new Type table
Type = var a=SUMMARIZE('Table','Table'[Year_Month])
var b={"Total"}
return UNION(a,b)
2.Then create a measure to calculate the sum
Sum =
VAR a =
SUMMARIZE ( FILTER ( 'Type', [Year_Month] <> "Total" ), [Year_Month] )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Year_Month] IN a )
3.Then create a measure
Sum_display =
VAR a =
SUMMARIZE ( ALLSELECTED ( 'Type' ), [Year_Month], "Sum", [Sum] )
RETURN
IF ( SELECTEDVALUE ( 'Type'[Year_Month] ) = "Total", SUMX ( a, [Sum] ), [Sum] )
4.Put the column of type table and the sum_display measure to the visual
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-xinruzhu-msft Can you please let me know how to get total column for running total. I tried this method for running total and its not working
Hi @Anonymous
You can refer to the following example
Sample data
1.Create a new Type table
Type = var a=SUMMARIZE('Table','Table'[Year_Month])
var b={"Total"}
return UNION(a,b)
2.Then create a measure to calculate the sum
Sum =
VAR a =
SUMMARIZE ( FILTER ( 'Type', [Year_Month] <> "Total" ), [Year_Month] )
RETURN
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Year_Month] IN a )
3.Then create a measure
Sum_display =
VAR a =
SUMMARIZE ( ALLSELECTED ( 'Type' ), [Year_Month], "Sum", [Sum] )
RETURN
IF ( SELECTEDVALUE ( 'Type'[Year_Month] ) = "Total", SUMX ( a, [Sum] ), [Sum] )
4.Put the column of type table and the sum_display measure to the visual
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Any idea how to get this to sort correctly when working with a full year since you'll have 2023-1 and 2023-10 and BI will format the "Year_Month" column in the "Type" table as text? Also, if it could be scalable to include future years, that would wonderful. Great solution otherwise though!
Thank you for providing the example and steps you've taken to create a clustered column chart with a total bar in Power BI. It looks like you've already created the necessary measures and set up your visual correctly. Here's a summary of the steps you've taken:
Your output appears to be a clustered column chart with the "Total" bar included, which is exactly what you were looking for. This approach is common in Power BI for displaying a total bar in a clustered column chart.
If you have any specific questions or need further assistance with this Power BI setup, please feel free to ask, and I'll be happy to help.
To add a total bar to a clustered column chart in Power BI, you can follow these steps:
Create Your Clustered Column Chart:
Calculate the Total:
For example, if you want to calculate the total of a column called "Value," you can create a DAX measure like this:
Total Value = SUM(YourTableName[Value])
Replace YourTableName with the actual name of your table and Value with the name of the column you want to total.
Add the Total to the Chart:
Format the Total Bar:
Adjust Axis and Scales:
Now, your clustered column chart should include a separate total bar alongside the clustered bars, displaying the total value you calculated. You can further customize the appearance of the total bar to match your desired chart aesthetics.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
90 | |
89 | |
79 | |
70 | |
68 |
User | Count |
---|---|
222 | |
128 | |
117 | |
82 | |
77 |