Forum Discussion

Hoping's avatar
Hoping
Icon for Helper III rankHelper III
2 years ago
Solved

Multi Valued Parameter in Report Builder with a a DAX Query

I am creating a paginated report from a report from a Power BI model.   I am trying to pass multiple valued parameter to the DAX query.     I see that a lot of blogs say it is not possible. I wan...
  • OwenAuger's avatar
    2 years ago

    Hi Hoping 

    It is certainly possible to have multiple-valued parameters in Paginated Report passed to the DAX query for a Dataset.

     

    It's a while since I'd set one up, but I was able to do so just now following this article which covers some examples of query-level parameters (among other things). See the section near to the top titled Parameters and filters that are applied at the Query Level.

     

    See also this post from Chris Webb.

     

    I've attached my test files in case they're of any help.

     

    In the example I set up, using Query Designer, I ended up with this query which uses the RSCustomerDaxFilter syntax:

    EVALUATE SUMMARIZECOLUMNS('SampleTable'[SampleColumn], RSCustomDaxFilter(@SampleTableSampleColumn,EqualToCondition,[SampleTable].[SampleColumn],String))

     

    This is translated into a proper DAX query when the report is run, e.g.

    EVALUATE
    SUMMARIZECOLUMNS (
        'SampleTable'[SampleColumn],
        FILTER (
            VALUES ( 'SampleTable'[SampleColumn] ),
            ( 'SampleTable'[SampleColumn] IN { "B", "C", "D" } )
        )
    )

     

    For testing, the Data Source "Local_PBIX" is an Analysis Services connection to a local PBIX, which you can adjust by changing the Connection String.

     

    Does that help at all?

     

    Regards