Forum Discussion

adavid999's avatar
adavid999
Helper V
5 years ago
Solved

add And to if statement

Hello,

Please can anyone let me know how to add another argument to this measure where I want dim_table2[y] to also be filtered? So my aim is to return 1 if dim_table1[x] and dim_table2[y] is filtered, rather than just dim_table1[x] as it is at the moment?

 

Thanks,

A

 

filter measure =
CALCULATE (
IF (
ISFILTERED ( dim_table1[x] ),
1,
0
),
ALLSELECTED ( dim_table3[z] )
)
  • Here you go

     

    filter measure =
    CALCULATE (
    IF (
    ISFILTERED ( dim_table1[x] ) && ISFILTERED( dim_table1[y] ),
    1,
    0
    ),
    ALLSELECTED ( dim_table3[z] )
    )
     
    Pat

1 Reply

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    Here you go

     

    filter measure =
    CALCULATE (
    IF (
    ISFILTERED ( dim_table1[x] ) && ISFILTERED( dim_table1[y] ),
    1,
    0
    ),
    ALLSELECTED ( dim_table3[z] )
    )
     
    Pat