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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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