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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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