cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
murali5431
Helper III
Helper III

Combining OR & AND in multi-value parameters

Hi,

 

I have 3 parameters in my report query. The system generated DAX is as follows. I need to modify below query such that either I enter a combination of [CNTR] & [CNTR_DT] or enter just enter [SUPP_LD_NO] as the parameter, leaving other two fields blank.

 

EVALUATE SUMMARIZECOLUMNS('Data'[CNTR], 'Data'[CNTR_DT], 'Data'[SUPP_LD_NO], RSCustomDaxFilter(@DataCNTR,EqualToCondition,[Data].[CNTR],String), RSCustomDaxFilter(@DataCNTRDT,EqualToCondition,[Data].[CNTR_DT],DateTime), RSCustomDaxFilter(@DataSUPPLDNO,EqualToCondition,[Data].[SUPP_LD_NO],String))

 

Assuming I was clear with my requirement, please assist.

 

Regards,

Muralidhar

3 REPLIES 3
Hariharan_R
Resolver I
Resolver I

Hi Murali,

    Use custom DAX query option and use the below code. 

Table = SUMMARIZECOLUMNS (
        'Data'[CNTR], 'Data'[CNTR_DT], 'Data'[SUPP_LD_NO],
FILTER (
Data,
(FORMAT ( Data[CNTR_DT], "YYYY-MM-DD" )
<= FORMAT ("2020-01-01", "YYYY-MM-DD" )
&& (PATHCONTAINS ( "A", DATA[CNTR] )))
|| PATHCONTAINS ("1ABC", DATA[SUPP_LD_NO])
))
You need to add expression for parameters - Join(Parametername,"|") as like to make it work. Also you need to handle ALL in case if it is blank
 
Thanks
Hari

@Hariharan_R .. I am unable to replicate your suggestion into my program, as it is still asking me to enter values in other fields. Can you let me know how I can modify below to accomplish it.

 

EVALUATE SUMMARIZECOLUMNS('Data'[CNTR], 'Data'[CNTR_DT], 'Data'[SUPP_LD_NO], RSCustomDaxFilter(@DataCNTR,EqualToCondition,[Data].[CNTR],String), RSCustomDaxFilter(@DataCNTRDT,EqualToCondition,[Data].[CNTR_DT],DateTime), RSCustomDaxFilter(@DataSUPPLDNO,EqualToCondition,[Data].[SUPP_LD_NO],String))

 

Thanks for your help!

Muralidhar

v-janeyg-msft
Community Support
Community Support

Hi, @murali5431 

 

I reproduced your scene in report builder, Is your data source 'AS'? I found that the choice of parameters is in the order of creating the parameters. And if you choose multiple options, it can't contain a null value by default. And it seems that only the value can be customized, and the interaction between the parameters can't be controlled.

v-janeyg-msft_0-1621413338493.png

If you still have problems, please feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.