Forum Discussion

sjehanzeb's avatar
sjehanzeb
Icon for Resolver I rankResolver I
6 years ago
Solved

Filter Data with Mandatory values

I have an accounting data with many fields. Is there a possibility to filter data where    A journal ID has specific two data values (mandatory). i.e. show only those entries which has specific acc...
  • v-alq-msft's avatar
    6 years ago

    Hi, sjehanzeb 

     

    Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.


    Table:

     

    You may create a measure as below.

    Visual Control = 
    var _jid = SELECTEDVALUE('Table'[J ID])
    return
    IF(
        COUNTROWS(
            FILTER(
                ALL('Table'),
                'Table'[J ID]=_jid&&
                'Table'[Account]="Cash"
            )
        )>0&&
        COUNTROWS(
            FILTER(
                ALL('Table'),
                'Table'[J ID]=_jid&&
                'Table'[Account]="Payable"
            )
        )>0,
        1,0
    )

     

    Finally you need to put the measure in the visual level filter to display the result.

     

    Best Regards

    Allan

     

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