cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
THENNA_41
Helper IV
Helper IV

Sleected value show unselected hide in visual

 i have a power bi data 2020 and 2021 years . i choosed clusterd bar chart and slicer like  

THENNA_41_1-1624348753886.png

 

if i choose 2020 filter i want to hide 2021 data in visuals ? any idea ?  thanks in advance 

 

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

Hi  @THENNA_41 ,

I create some data:

vyangliumsft_0-1624608388967.png

vyangliumsft_1-1624608388970.png

Here are the steps you can follow:

1. Create measure.

Flag =
var _select=SELECTEDVALUE('Table'[Year])
return
IF(
    VALUE(RIGHT(MAX('Table'[MonthYear]),4))=_select,1,0)

2. Place Measure[Flag] in Filters, set is = 1, and Apply filter.

vyangliumsft_2-1624608388972.png

3. Result:

The slicer selects 2020 and displays the data of 2020:

vyangliumsft_3-1624608388974.png

The slicer selects 2021 and displays the data of 2021:

vyangliumsft_4-1624608388976.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.

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @THENNA_41 ,

I create some data:

vyangliumsft_0-1624608388967.png

vyangliumsft_1-1624608388970.png

Here are the steps you can follow:

1. Create measure.

Flag =
var _select=SELECTEDVALUE('Table'[Year])
return
IF(
    VALUE(RIGHT(MAX('Table'[MonthYear]),4))=_select,1,0)

2. Place Measure[Flag] in Filters, set is = 1, and Apply filter.

vyangliumsft_2-1624608388972.png

3. Result:

The slicer selects 2020 and displays the data of 2020:

vyangliumsft_3-1624608388974.png

The slicer selects 2021 and displays the data of 2021:

vyangliumsft_4-1624608388976.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.

View solution in original post

amitchandak
Super User
Super User

@THENNA_41 , if the visual using month year from the same table(related table) from where year is coming then it should filter. That is the default feature. What is issue you are facing ?

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

i am trying to hide the  unseleted month empty filds  in visuals  please find  the attached screen shot for your reference 

THENNA_41_0-1624349373607.png

if i choose 2020 only selected year months only visbile in chart .

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.