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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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