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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.