Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to Hide Useless Date Choices In Filter Box and X Axis

I use date table's Year & Month for the filter box to customer for report period selection, but the droplist shows all months of 2022, which only January has available data. I want to hide the choice...
  • v-easonf-msft's avatar
    v-easonf-msft
    4 years ago

    Hi, Anonymous 

    You can try formulas like the following:

    inf = CALCULATE(Min('Table'[Date]),FILTER(ALL('Table'),'Table'[Value1]<>0||'Table'[value2]<>0))
    sup = CALCULATE(Max('Table'[Date]),FILTER(ALL('Table'),'Table'[Value1]<>0||'Table'[value2]<>0))
    filter = IF(SELECTEDVALUE('Table'[Date])>=[inf]&&SELECTEDVALUE('Table'[Date])<=[sup],1,0)

    Then apply measure 'filter' to the filter pane of your chart.

    Please check my attachment for more detail.

    If it doesn't work, please share your sample file for further research. 

     

    Best Regards,
    Community Support Team _ Eason