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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Filter the bars of a bar chart dynamically

Hello everyone

I need to make a comparison of the total sales between two periods in a bar graph, without the need to show the year in the legend, but rather create two year selection criteria and that each of the criteria allows to modify a bar and not both.

For example

Filter 1
Bar 1

Filter 2
Bar 2

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @Syndicate_Admin 

Please try the following steps:

1. Copy a new table 'Table2'

calculated table:

Table2 = Table1

2. Enter the following table:

veasonfmsft_0-1662451905841.png

3. Add the following mesure to the bar graph to compare the results

Sales =
SWITCH (
    SELECTEDVALUE ( 'Comparison Table'[Bar] ),
    "Bar1", SUM ( Table1[Sales] ),
    "Bar2", SUM ( Table2[Sales] )
)

veasonfmsft_1-1662452067011.png

Best Regards,
Community Support Team _ Eason

 

View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @Syndicate_Admin 

Please try the following steps:

1. Copy a new table 'Table2'

calculated table:

Table2 = Table1

2. Enter the following table:

veasonfmsft_0-1662451905841.png

3. Add the following mesure to the bar graph to compare the results

Sales =
SWITCH (
    SELECTEDVALUE ( 'Comparison Table'[Bar] ),
    "Bar1", SUM ( Table1[Sales] ),
    "Bar2", SUM ( Table2[Sales] )
)

veasonfmsft_1-1662452067011.png

Best Regards,
Community Support Team _ Eason

 

amitchandak
Super User
Super User

@Syndicate_Admin , refer

How Interactions Work- Split Page using interactions to compare - https://youtu.be/GIfRKzhMaR4

 

or

How to use two Date/Period slicers

https://youtu.be/WSeZr_-MiTg

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors