Forum Discussion
Dynamic M Query doesn't take value from slicer as parameter
- 9 months ago
Ok, finally I found out the problem.
The is that you cannot have a table for the filter with several columns and showing not only the bindedParamter column in the filter but another field.
So what works:
Simple Slicer where only the field where the binded Parameter is attached is in the filter field (in my case the "egmId" field)
What no works:
Simple slicer where only another field (in my case the "identifier" field) of the filter Table is attached in the filter Fields. So it seems there is no way to show another value in the slicer than using for binded parameters filter...
- 9 months ago
Hi lenfloge,
The parameter binding mechanism works at the data model level, not the visualization level So when you select a value in the slicer Power BI passes the actual selected value to the parameter (not a mapped/lookup value)
So here is 3 or 4 options or lets called it workarounds you can try it:-
First Option:
- Modify your filter table to show both values:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XcuxEcAgCEDRXajDHUREmCVngaL7jxDT5he/e88D00bjtEBRqWfE6FscLVNtNaXhDS5gasqE9MXQrwNz6txJaHddKHsFju0Fw1dIqSVG9R+8ofcX", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [egmId = _t, Identifier = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"egmId", type text}, {"Identifier", type text}}), #"Combined Column" = Table.AddColumn(#"Changed Type", "Display", each [Identifier] & " (" & [egmId] & ")", type text) in #"Combined Column"- Then bind the parameter to egmId but use the Display column in the slicer
Second Option:
- Instead of a standard slicer use a Table visual as your selection mechanism:
- Create a table visual with your Identifier column
- Users can click on rows to filter
- The parameter binding will still work with the underlying egmId
Third Option :
- Also consider using customvisuals from AppSource that might handle this mapping better
Final Option :
- If this limitation is a deal breaker you might need to:
Use Import mode instead of DirectQuery
Implement the filtering logic differently
Use a different tool that supports this use case natively
if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.
Ok, finally I found out the problem.
The is that you cannot have a table for the filter with several columns and showing not only the bindedParamter column in the filter but another field.
So what works:
Simple Slicer where only the field where the binded Parameter is attached is in the filter field (in my case the "egmId" field)
What no works:
Simple slicer where only another field (in my case the "identifier" field) of the filter Table is attached in the filter Fields. So it seems there is no way to show another value in the slicer than using for binded parameters filter...
- Ahmed-Elfeel9 months agoSuper User
Hi lenfloge,
The parameter binding mechanism works at the data model level, not the visualization level So when you select a value in the slicer Power BI passes the actual selected value to the parameter (not a mapped/lookup value)
So here is 3 or 4 options or lets called it workarounds you can try it:-
First Option:
- Modify your filter table to show both values:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XcuxEcAgCEDRXajDHUREmCVngaL7jxDT5he/e88D00bjtEBRqWfE6FscLVNtNaXhDS5gasqE9MXQrwNz6txJaHddKHsFju0Fw1dIqSVG9R+8ofcX", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [egmId = _t, Identifier = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"egmId", type text}, {"Identifier", type text}}), #"Combined Column" = Table.AddColumn(#"Changed Type", "Display", each [Identifier] & " (" & [egmId] & ")", type text) in #"Combined Column"- Then bind the parameter to egmId but use the Display column in the slicer
Second Option:
- Instead of a standard slicer use a Table visual as your selection mechanism:
- Create a table visual with your Identifier column
- Users can click on rows to filter
- The parameter binding will still work with the underlying egmId
Third Option :
- Also consider using customvisuals from AppSource that might handle this mapping better
Final Option :
- If this limitation is a deal breaker you might need to:
Use Import mode instead of DirectQuery
Implement the filtering logic differently
Use a different tool that supports this use case natively
if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.