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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
rane19
Helper I
Helper I

How to restrict only multi year based on single-selected slicer in bar chart axis ? Power BI

Sample Data :

Date      Type Family Type Sub Value
2018/01/01 Faimly_A A 377
2018/01/01 Faimly_A A 30
2018/01/01 Faimly_A B 470
2018/01/01 Faimly_B B 310
2018/01/01 Faimly_B C 112
2018/01/01 Faimly_B C 249
2019/01/01 Faimly_A A 172
2019/01/01 Faimly_A A 74
2019/01/01 Faimly_A B 283
2019/01/01 Faimly_B B 361
2019/01/01 Faimly_B C 33
2019/01/01 Faimly_B C 444
2020/01/01 Faimly_A A 211
2020/01/01 Faimly_A A 149
2020/01/01 Faimly_A B 377
2020/01/01 Faimly_B B 405
2020/01/01 Faimly_B C 139
2020/01/01 Faimly_B C 125

 

Conditions :

I have another SCORCARD  to show only single year - filtered by another slicers of single-selecting 1 -Year slicer

and 2 - Group - the hierarchy slicers of column "Type Family" - "Type Sub"

 

Goal :

At the same time show ONLY ,1 -current selected year & 2- the previous year (y-1) based on the single-selecting 1 -Year slicers while keeping interactions with Hierarchy group slicer .

 

How can i achieve it ?

Image :

 

Capture.PNG

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

I answered a similar question here - Flex a Pivot Table to show data for x months ended a certain user defined month.

Hope this helps


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish , appreciate for your reply and it is a very smart way to provide flexibility.

But my situation  aims to keep the easiest and intuitive UI that "select only the current year you wnat to view" hence you see to chart have only 2 bar as ell .  I need a measure to locking only 2 year in the chart .

Concept like   : 

# 2_years_period_measure =

    VAR current_year = selectedvalue(Calendar[Date].[year]) 

   RETURN

   filter(  current_year && current_year -1  )

hence use "2_years_period_measure"  in chart graph Axis .

But i lack of knowledge to accomplish it .

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thankyou , amazing!

 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.