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

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.

Reply
Guneet_B21
Helper II
Helper II

adding 2 bars

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

 

Guneet_B21_0-1673604980177.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

RicoZhou_0-1673860377776.png

X axis table:

X axis = UNION(VALUES('Table'[Type]),{"Total","ff+ts"})

Relationship:

RicoZhou_1-1673860412653.png

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.

RicoZhou_2-1673860505379.png

 

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.

 

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Anonymous
Not applicable

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:

RicoZhou_0-1673860377776.png

X axis table:

X axis = UNION(VALUES('Table'[Type]),{"Total","ff+ts"})

Relationship:

RicoZhou_1-1673860412653.png

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.

RicoZhou_2-1673860505379.png

 

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

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors