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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
romika
New Member

Filter table with conditions based on selected value of slicer

Hi,

  • I have one sql table named as INFO with columns (project, startdate,enddate)
  • I created calender table using DAX :
    Calender = ADDCOLUMNS(CALENDAR (DATE (1990, 1, 1), DATE (YEAR(TODAY()), 12, 31)),"DateInt",FORMAT([Date],"mm/dd/yyyy"))
    I followed "https://www.youtube.com/watch?v=zhWtU0DynCk" to get single date selected by user from slicer.

I want to filter my INFO table as startdate <= selecteddate from slicer <= enddate. 

 

Thanks for helping in advance!!

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @romika ,

 

You can bind each field to a parameter then you can repeat these steps if you have other fields to bind to other parameters.

And please ensure the connection type is"direct query".

For more details, you can learn more about the document.

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters 

 

Best Regards,
Liang
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-lianl-msft
Community Support
Community Support

Hi @romika ,

 

You can bind each field to a parameter then you can repeat these steps if you have other fields to bind to other parameters.

And please ensure the connection type is"direct query".

For more details, you can learn more about the document.

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters 

 

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

Fowmy
Super User
Super User

@romika 

When you create a table, you cannot access the slicer selection values as the model gets finalized prior to your report layer where the slicer exists. 
If you are creating a virtual table within a measure,  you can access the slicer value using SELECTEDVALUE function.

If you want to achieve dynamic filtering of your data when you pull it from the server then Dynamic M Query Parameter which a new feature would help you: 

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy 
Thanks for the suggestion.

I tried to follow the above documentation and as there is limitation "A single parameter cannot be bound to multiple fields nor vice-versa" . In my case I want to bind same parameter to two columns (startdate and enddate).

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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