Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filter Issue with Paginated Report

The paginated report, Issue.
I need help with the power BI paginated report for user requirements.
I have 6 parameters that are to be filtered on the report.
Order No, Customer, Material No, MLFB, GG, and Sales Office.

 

Problem statement:- User can select any filter whichever wants.
Example 1 ) User can select Order No and Customer and keep other filters as blank
Example 2) User can select MLFB, Customer, and Sales Office and keep other filters blank
He can select any of the filters he wants. Each of the filters is binded to master records that are individual data sets. The user does not want to cascade the filters.

 

Outcome required:- By selecting the filters which the user wants, a report has to be generated which will have the records having the value selected in the filters.

 

Issue Faced:-When any of the filters are kept blank, blank data is loaded onto the page. Ideally, it should have loaded the data according to the filters which are selected. In paginated since the filter work in 'AND', I am not sure how to achieve this requirement.

 

 

Any help will be appreciated...

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Anonymous 

    Hello!

    RSCustomDaxFilter is a dynamic expression. Try transform it in general Dax-Code like FILTER() and add the OR() function.

     

    For example.
    RSCustomDaxFilter(@OpenSalesorderBUCode,EqualToCondition,[OpenSalesorder].[BU Code],String)) 

     

    Transfrom:

    FILTER(VALUES('OpenSalesorder‘[BU Code]), OR(('OpenSalesorder'[BU Code] = @OpenSalesorderBUCode), ('OpenSalesorder'[BU Code] = @OpenSalesorderBUCode)

     


    Paul Zheng _ Community Support Team

3 Replies

  • You have not mentioned what sort of query language you are using, but you can achieve this in most languages by using logic like the following in your query:

     

    ( Column1 = @Parameter1  OR @Parameter1 IS NULL)
    AND
    ( Column2 = @Parameter2  OR @Parameter2 IS NULL)

    And sometimes instead of NULL I will union a value like "<ALL>" into the query for the available values and use that instead

     

    ( Column1 = @Parameter1  OR @Parameter1 = '<ALL>')
    AND
    ( Column2 = @Parameter2  OR @Parameter2 = '<ALL>')

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      Thank You for your Reply. I am using DAX with RSCustomDaxFilter

       

      When i connect to SQL directly to create my report i use below query

      Select [Ask Dt.], [Block Status], [BU], [BU Code], [BU Division], [BU Name], [Office Name], [Open OV]
      from OpenSalesorder where (OpenSalesorder.[Plant]=@Plant OR @Plant='ALL') AND (OpenSalesorder.[BU Code]=@BU OR @BU='0') AND
      (OpenSalesorder.[Order No.]=@OrderNo OR @OrderNo='0')

       

      which gives me required output but i need to connect it from 'DataSet' , when i do that i get below query 

       

      EVALUATE SUMMARIZECOLUMNS('OpenSalesorder'[Order No.], 'OpenSalesorder'[BU], 'OpenSalesorder'[Plant], 'OpenSalesorder'[Distr. Channel], 'OpenSalesorder'[Office Code], 'OpenSalesorder'[MLFB], RSCustomDaxFilter(@OpenSalesorderBUCode,EqualToCondition,[OpenSalesorder].[BU Code],String)) 

       

      I am not sure how to use OR with RSCustomDaxFilter 😞

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    Hello!

    RSCustomDaxFilter is a dynamic expression. Try transform it in general Dax-Code like FILTER() and add the OR() function.

     

    For example.
    RSCustomDaxFilter(@OpenSalesorderBUCode,EqualToCondition,[OpenSalesorder].[BU Code],String)) 

     

    Transfrom:

    FILTER(VALUES('OpenSalesorder‘[BU Code]), OR(('OpenSalesorder'[BU Code] = @OpenSalesorderBUCode), ('OpenSalesorder'[BU Code] = @OpenSalesorderBUCode)

     


    Paul Zheng _ Community Support Team