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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors