cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
JojoPBI
New Member

PBI Report Builder - Multi-value parameter with DAX query

Hello,

 

I'm currently trying to create a Power BI report, where the datasource is a Power BI Dashboard.
I want to have a multi-value parameter to filter on a specific field of my report.

Here is what I have done:

- Created a report level multi-value parameter

- Associated the report parameter with a query parameter within my dataset

- Declared a parameter within query designed

 

And then I'm using the following code:

 

EVALUATE SUMMARIZECOLUMNS('mytable'[col1], 'mytable'[col2],
TREATAS({@parameter},'mytable'[col1])
)

 

Issue is, when I'm executing the report, the filter only work if I'm putting a single value in the parameter.

As soon as I put more than one value, I'm getting an empty report.

 

I have also tried with the following code:

 

FILTER(
KEEPFILTERS(VALUES('mytable'[col1])),'mytable'[col1] IN {@parameter}))

 

But I'm getting the same behaviour.

 

What am I doing wrong?

 

Thanks for any help you can provide.

 

1 ACCEPTED SOLUTION
bradsy
Microsoft
Microsoft

DAX does not natively support multivalue parameters so a workaround was added a few years ago. This article might help. https://blog.crossjoin.co.uk/2019/11/03/power-bi-report-builder-and-rscustomdaxfilter/ 

View solution in original post

2 REPLIES 2
JojoPBI
New Member

Thanks for your answer. 

I was using this blog https://torchcloudconsulting.medium.com/power-bi-report-builder-parameterizing-dax-queries-59e95a12b... as a reference to try and create my query but seems like its solution is untested.

 

I ended up concatenating my multi-value parameter into a single string with pipes when passing it from the report to the query, and use PathContains function, but it's quite an ugly solution.

 

Would MDX be better to request a Power BI dataset from Report Builder? Seems like it's the only other solution as I'm trying to connect to a Databricks datasource, and this is only supported in Power BI but not Report Builder.

bradsy
Microsoft
Microsoft

DAX does not natively support multivalue parameters so a workaround was added a few years ago. This article might help. https://blog.crossjoin.co.uk/2019/11/03/power-bi-report-builder-and-rscustomdaxfilter/ 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.