Forum Discussion

Nadege's avatar
Nadege
New Member
8 months ago
Solved

Cannot add multi value query parameter '?' for dataset 'DataSet_Justificatif' because it is not supp

I use AS400 like datasource I want to create a report with 3 filter : year (unique choice ), Mois (multiple choise with all 12 month as default value), City (multiple choice with all city store in m...
  • Mauro89's avatar
    8 months ago

    Hi Nadege!

     

    This error occurs because AS400 (IBM i/DB2) doesn't support multi-value parameters with the ? placeholder syntax in the way Power BI Report Builder expects.

    Solution: Use the IN clause with dynamic SQL

    Instead of using ? for multi-value parameters, you need to construct the parameter list as a comma-separated string. Here's how:

    1. Change your parameter to allow multiple values and set it to return a comma-separated string

    2. Modify your query to use the parameter directly in the SQL:

    with cedant as ( 
        select client_number, service_agreement_number, SELLING_GROUP 
        from dwe_service_agreement 
        where selling_group in (@SellingGroup)  -- Use @ParameterName
        and sag_on_live = 'Y'
    ), 
    nb as (
        select periode as "Période", SELLING_GROUP as "Groupe cédant"
        from DWE_WRK_REFI_PREC a 
        inner join cedant on client_number = num_adh and service_agreement_number = num_cpt
        where year(periode) = @Year 
        and month(periode) in (@Months)  -- Multi-value parameter
    ) 
    select * from nb
    1. Configure the multi-value parameters (@Months, @SellingGroup) in Report Builder to use JOIN with comma separator in the parameter properties.

    If this still doesn't work with AS400, you may need to use a stored procedure or build the SQL dynamically using expressions.

     

    Best regards!

    PS: If you find this post helpful consider leaving kudos or mark it as solution