Forum Discussion

patlopes's avatar
patlopes
Frequent Visitor
3 years ago
Solved

Filter one column with reference to two other columns

Hi,

I have a table as sample below 

 

I need to filter the table by Category when all Sub-Categories are Inactive. In the sample, after filtering, the table would only show Cat B. 

Is it possible with DAX ?

Thank you

  • you can also plot with the measure like below, maybe more intuitive:

     

3 Replies

  • hi patlopes 

    try to plot a visual with Category and filter the visual with a measure like:

    Measure = 
    VAR _list= 
    CONCATENATEX(
        VALUES(TableName[Status]), 
        TableName[Status]
    )
    RETURN
    IF(
        _list = "Inactive",
        1, 0
    )

    it worked like:

     

  • you can also plot with the measure like below, maybe more intuitive:

     

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi patlopes 

    please try

    FilterMeasure =
    INT (
    ISEMPTY (
    FILTER (
    CALCULATETABLE (
    VALUES ( 'Table'[Status] ),
    ALLSELECTED ( 'Table' ),
    VALUES ( 'Table'[Category] )
    ),
    'Table'[Status] = "Active"
    )
    )
    )