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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ferdinando86
New Member

Selecting filter items dynamically

Hi all,
is it possible to select a filter item dynamically? Example: select current month in a months list.

Thanks.
1 ACCEPTED SOLUTION

Hi @ferdinando86 ,

 

look at this.

 

https://community.powerbi.com/t5/Desktop/Date-Filter-default-to-current-day/m-p/835608/highlight/tru...

 

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

6 REPLIES 6
ferdinando86
New 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:

VisualFilter1.PNG

 

Next month:

VisualFilter2.PNG

 

Is it possible?

 

Best Regards

Ferdinando

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

https://community.powerbi.com/t5/Desktop/Date-Filter-default-to-current-day/m-p/835608/highlight/tru...

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Hi @mwegener ,

 

I did but just now I undestand your solution😊

 

Thanks!

v-alq-msft
Community Support
Community Support

Hi, @ferdinando86 

 

Based on your description, I created data to reproduce your scenario.

Table:

d1.png

 

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.

d2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @ferdinando86 ,

 

look at this.

 

https://community.powerbi.com/t5/Desktop/Date-Filter-default-to-current-day/m-p/835608/highlight/tru...

 

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Greg_Deckler
Super User
Super User

In Power Query or DAX? In DAX you can use:

MONTH(TODAY())

to get today's month.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.