Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Logic help needed, conditional IF

Hello all gurus, I am new to PowerBI and need some help! 

I have a database like below: 

 

I need some help to figure out a DAX for this logic: if a customer_id was identified as an "NSU Customer", then that customer_id is a customer regardless of their charge_plan. 

 

So eventually I want to get to a table like this: 

 

Appreciated any advice, 

 

  • Hi Anonymous ,

     

    Try this one as a measure, please.

     

    Measure =
    IF (
        "NSU Customer"
            IN CALCULATETABLE (
                VALUES ( 'table1'[NSU plan group] ),
                ALLEXCEPT ( 'table1', 'table1'[customer_id] )
            ),
        "Customer",
        "Not Customer"
    )
    

     

     

     

    Best Regards,

2 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi Anonymous ,

     

    Try this one as a measure, please.

     

    Measure =
    IF (
        "NSU Customer"
            IN CALCULATETABLE (
                VALUES ( 'table1'[NSU plan group] ),
                ALLEXCEPT ( 'table1', 'table1'[customer_id] )
            ),
        "Customer",
        "Not Customer"
    )
    

     

     

     

    Best Regards,

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you , it works! Much appreciated your help!