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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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