Forum Discussion
Selecting filter items dynamically
is it possible to select a filter item dynamically? Example: select current month in a months list.
Thanks.
6 Replies
- Greg_DecklerCommunity ChampionIn Power Query or DAX? In DAX you can use:
MONTH(TODAY())
to get today's month. - mwegenerMost Valuable Professional
- v-alq-msftCommunity Support
Hi, ferdinando86
Based on your description, I created data to reproduce your scenario.
Table:
You may create a measure like below.
IsDisplay = var _date = SELECTEDVALUE('Table'[Date]) return IF( MONTH(_date)=MONTH(TODAY())&& YEAR(_date)=YEAR(TODAY()), 1,0 )Then you need to put the measure in the visual level filter. Here is the result. Today is 4/9/2020. So the result displays the data on 4/1/2020 and 4/2/2020.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- ferdinando86New Member
Thanks for the replys.
My problem is different. I'd like to automatically "select" current month in filter visual. An example below.
Current month:
Next month:
Is it possible?
Best Regards
Ferdinando
- mwegenerMost Valuable Professional
Hi ferdinando86 ,
did you see my reply?
I create a column where i renamed the actual month as "Actual Month", to set the default filter on it.
Similar to this..
- ferdinando86New Member