Forum Discussion

anshusaketsingh's avatar
anshusaketsingh
Frequent Visitor
2 years ago
Solved

Query To Pass Multiple Values From a Parameter in Paginated Report Using RSCustomDaxFilter

I am trying to create a Paginated report with Category as filter.

Its working fine with DAX file but they can only accept 1 value at a time. I switched to RSCustomDaxFilter but somehow getting the below error. 

Do anyone know how to fix it?

 

 

Query For Multiple Values From a Parameter (Not Working)-

DEFINE
VAR FilterTable =
RSCustomDaxFilter(@Category, EqualToCondition, [Orders].[Category], String)

EVALUATE
SUMMARIZECOLUMNS (
'Orders'[Category],
'Orders'[Sub-Category],
FilterTable,
"SumSales", CALCULATE ( SUM ( 'Orders'[Sales] ) )
)
ORDER BY
"SumSales" DESC,
'Orders'[Category],
'Orders'[Sub-Category]

  • So, apparently it is some weird bug in PowerBI Report Builder.

    Rewriting the same query without space for RSCustomDaxFilter like below solved the problem.

     

    DEFINE
    VAR FilterTable =
    RSCustomDaxFilter(@Category,EqualToCondition,[Orders].[Category],String)

    EVALUATE
    SUMMARIZECOLUMNS (
    'Orders'[Category],
    'Orders'[Sub-Category],
    FilterTable,
    "SumSales", CALCULATE ( SUM ( 'Orders'[Sales] ) )
    )
    ORDER BY
    "SumSales" DESC,
    'Orders'[Category],
    'Orders'[Sub-Category]

3 Replies

  • So, apparently it is some weird bug in PowerBI Report Builder.

    Rewriting the same query without space for RSCustomDaxFilter like below solved the problem.

     

    DEFINE
    VAR FilterTable =
    RSCustomDaxFilter(@Category,EqualToCondition,[Orders].[Category],String)

    EVALUATE
    SUMMARIZECOLUMNS (
    'Orders'[Category],
    'Orders'[Sub-Category],
    FilterTable,
    "SumSales", CALCULATE ( SUM ( 'Orders'[Sales] ) )
    )
    ORDER BY
    "SumSales" DESC,
    'Orders'[Category],
    'Orders'[Sub-Category]

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi anshusaketsingh ,

    Based on the description, try to select the allow multiple values for parameter.

    Viewing the following documents to learn more information.

    Solved: Paginated Report - multiple parameter via DAX quer... - Microsoft Fabric Community

    Add a multi-value parameter to a paginated report - Power BI | Microsoft Learn

     

    Best Regards,

    Wisdom Wu

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

    • anshusaketsingh's avatar
      anshusaketsingh
      Frequent Visitor

      Already done that , thats not an issue. The parameter is getting populated correctly with multiple value.

       

      I checked it with Filter query and it is giving output for same parameter but it is not able to handle multiple values. It only works if I select 1 value at a time.

       

      DEFINE
      VAR FilterTable = 
                      FILTER(
      KEEPFILTERS(VALUES('Orders'[Category])),
      ('Orders'[Category] IN {(@Category)})
      )