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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Mauritius360
New Member

Bar chart 4 years

hello,

i have a barchart as per below, when selecting the months from the date slicer, i want the barchart to display the selected months for each year in the barchart. This will allow me to do comparison for same month but all years in the dataset.
for example when selecting the months of Jan/Feb/Mar, the barchart should display years 2021/2022/2023/2024 but the values will be that of Jan/Feb/Mar.

Can you please help ?

thanking you

Mauritius360_0-1693400427214.png

 

2 REPLIES 2
technolog
Super User
Super User

I hope this message finds you well. I've noticed that this solution remain unresolved. If any of you have managed to find a resolution to the issue, I kindly request that you share your solution for the benefit of the entire community. Alternatively, if you're still facing challenges, please do let us know as well.

Your insights and updates will greatly assist others who might be encountering the same challenge.

Anonymous
Not applicable

Hi  @Mauritius360 ,

 

If the field you placed in your slicer is from the same table as the field placed in Visual, you can try the following:

vyangliumsft_0-1693535987531.png

Place [Date] in X-axis as Date Hierarchy, and each year's data will display only the values of these Months as the slicer is selected

vyangliumsft_1-1693535987534.png

If the fields you place in your slicer and the fields placed in Visual are not from the same table and do not have any join relationships, you can try the following:

1. Create measure.

Flag =
var _select=SELECTCOLUMNS('Slicer_Table',"Month_number",[Month])
return
IF(
    FORMAT(MAX('Table'[Date]),"mmm")in _select,1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1693536003501.png

3. Result:

vyangliumsft_3-1693536003506.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.