Forum Discussion

rane19's avatar
rane19
Icon for Helper I rankHelper I
5 years ago
Solved

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 :

 

5 Replies

    • rane19's avatar
      rane19
      Icon for Helper I rankHelper I

      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 .

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        You may download my PBI file from here.

        Hope this helps.