Forum Discussion

Fern_21's avatar
Fern_21
Icon for Helper V rankHelper V
7 months ago
Solved

How to use PATHCONTAINS to pass a multi-value parameter in a query in Report Builder

Hi all! I've a very heavy query in a Power BI Report Builder report. I tried to make it lighter by introducing parameters selected by the user. Since the parameters are multi-value, I mapped them...
  • v-ssriganesh's avatar
    7 months ago

    Hi, Fern_21,
    Thank you for posting your query in the Microsoft Fabric Community Forum.

    The value[items].[facility_code].&[3422] indicates that your query is using a hierarchy/member reference, not the actual scalar value (3422).

    PATHCONTAINS only works with plain scalar values (text or numbers). It cannot evaluate hierarchy keys, while CONTAINSSTRING still works because it performs a simple string comparison.

    To resolve this, make sure your dataset and filters use the base column value (the raw facility code) rather than a hierarchy level. Once the query returns 3422 instead of the hierarchy-formatted value, PATHCONTAINS will work correctly.

    Thanks, DataVitalizer for sharing valuable insights.

     

    Best regards,
    Ganesh Singamshetty.