Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi everyone,
i am looking for help with an issue im facing,
i have 3 types of product which i need to show the bar chart for.
but i also need to show the total of all the columns (which i was able to figure out)
and i am also required to show only the sum of 2 of these products
Solved! Go to Solution.
Hi @Guneet_B21 ,
I think there should be a [Type] column and a [Cal] column in your table. We need to create a table with all data you need and add the column into X aixs.
Here I create an easy sample to have a test.
Data table:
X axis table:
X axis = UNION(VALUES('Table'[Type]),{"Total","ff+ts"})
Relationship:
Measure:
Measure =
VAR _Cal =
SUM ( 'Table'[Cal] )
VAR _Total =
CALCULATE ( SUM ( 'Table'[Cal] ), ALLSELECTED ( 'Table' ) )
VAR _ffandts =
CALCULATE (
SUM ( 'Table'[Cal] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Type] IN { "ff", "ts" } )
)
RETURN
IF (
ISBLANK ( _Cal ),
SWITCH ( SELECTEDVALUE ( 'X axis'[Type] ), "Total", _Total, "ff+ts", _ffandts ),
_Cal
)
Result is as below.
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.
@Guneet_B21 , Can you check if this can help
Power BI - Show Grand total row or Avg Grand total row in Visual: https://youtu.be/OSwRZ4GUhxc
Hi Amit,
this solves the issue for including the total (which i have already done in my BI),
i still need a solution to add 2 types and show them as a seperate bar as shown in my screenshot
Hi @Guneet_B21 ,
I think there should be a [Type] column and a [Cal] column in your table. We need to create a table with all data you need and add the column into X aixs.
Here I create an easy sample to have a test.
Data table:
X axis table:
X axis = UNION(VALUES('Table'[Type]),{"Total","ff+ts"})
Relationship:
Measure:
Measure =
VAR _Cal =
SUM ( 'Table'[Cal] )
VAR _Total =
CALCULATE ( SUM ( 'Table'[Cal] ), ALLSELECTED ( 'Table' ) )
VAR _ffandts =
CALCULATE (
SUM ( 'Table'[Cal] ),
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Type] IN { "ff", "ts" } )
)
RETURN
IF (
ISBLANK ( _Cal ),
SWITCH ( SELECTEDVALUE ( 'X axis'[Type] ), "Total", _Total, "ff+ts", _ffandts ),
_Cal
)
Result is as below.
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.
Hi @Anonymous ,
there were some draw backs with this as well as i had seperate measures to execute the on and in this case it had to be done on columns.
I went and took a different route so i dont think i need to execute this now.
Thanks alot for your help, really appreciate it