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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ICD
Helper I
Helper I

Calling table-valued function with dynamic parameter-bind to multi-selected slicer in Powe BI report

Hi!

I need help

In the Power BI report I want to bind the multi-selected slicer to parameter and use it in calling
a table-valued function in DirectQuery mode and pass the text parameter concatenating all the selected in slicer values separeted by comma

If in slicer with 5 possible values (Id1,Id2,Id3,Id4,Id5) are selected only 2 => the TVF parameter must be 'Id1,Id5'

 

2 ACCEPTED SOLUTIONS

Hi, @lbendlin !

Thank you so much for useful information! It is perfect for slicers with singel selection!

 

I decided my problem after compilation of information in two videos:

https://www.youtube.com/watch?v=ilTeVH2Cwck

https://www.youtube.com/watch?v=7XR6vhdqLCw

 

 

let
          ProjectList = if SelectedProjectsIdsParameter is list then SelectedProjectsIdsParameter else {SelectedProjectsIdsParameter},
// Ensure all ProjectIds are treated as text
          IdListAsText = List.Transform(ProjectList, each Text.From(_)),
          Source = Sql.Database(MyServer, MyDatabase),
          pbi_PUs = Value.NativeQuery
         (Source, "SELECT

                     Column1, Column2, Column3 

                    FROM [Reports].[MyTVF] ('" & Text.Combine(IdListAsText, ",") & "')",
          null,
          [EnableFolding = true]

      )

in
    pbi_PUs

   

Best regards!

View solution in original post

2 REPLIES 2

Hi, @lbendlin !

Thank you so much for useful information! It is perfect for slicers with singel selection!

 

I decided my problem after compilation of information in two videos:

https://www.youtube.com/watch?v=ilTeVH2Cwck

https://www.youtube.com/watch?v=7XR6vhdqLCw

 

 

let
          ProjectList = if SelectedProjectsIdsParameter is list then SelectedProjectsIdsParameter else {SelectedProjectsIdsParameter},
// Ensure all ProjectIds are treated as text
          IdListAsText = List.Transform(ProjectList, each Text.From(_)),
          Source = Sql.Database(MyServer, MyDatabase),
          pbi_PUs = Value.NativeQuery
         (Source, "SELECT

                     Column1, Column2, Column3 

                    FROM [Reports].[MyTVF] ('" & Text.Combine(IdListAsText, ",") & "')",
          null,
          [EnableFolding = true]

      )

in
    pbi_PUs

   

Best regards!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.