Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

True or False Conditional formatting inside the same tables and DAX

Hi,

 

How can I compare the multiple column inside the same tables via Power BI formula and conditional formating?

 

I have a one Table that contains text and numbers from column B:I

Column B:E name called Table A and column F:I called Table B.

Column J is my output "YES" or "NO".

 

IF matched columns from B:E into the columns F:I then return the output is "YES" in column J and If not matched any of these columns then return the output is "No" in column J.

 

Data:

 

TABLE ATABLE B 
FRUIT LISTAREA CODELANGUAGESALES CODEFRUIT LISTAREA CODELANGUAGESALES CODESTATUS
Avocado3100ENEU01Avocado3100ENEU01YES
Avocado3100ENUSAvocado3100ENUSYES
Avocado3100ENUKAvocado3100ENUKYES
AvocadoWESTENUKAvocado3100ENUKNO
Avocado3100ENUKAvocado3100ENUKNO
Avocado3100ENUKAvocado3100ENUKNO
Avocado3100 UKAvocado3100ENUKNO
Avocado3100ENINDIA01Avocado3100ENUKNO
Avocado3100EN Avocado3100ENUKNO
Star FruitWESTENINDIA01Star FruitWESTENINDIA01YES
Star FruitNORTHENINDIA01Star FruitNORTHENINDIA01YES
Star FruitEASTENINDIA01Star FruitEASTENINDIA01YES
Star FruitSOUTHENINDIA01Star FruitSOUTHENINDIA01YES
Star FruitWESTENINDIA02Star FruitWESTENINDIA02YES
Star FruitNORTHENINDIA02Star FruitNORTHENINDIA02YES
Star FruitEASTENINDIA02Star FruitEASTENINDIA02YES
Star FruitSOUTHENINDIA02Star FruitSOUTHENINDIA02YES
Watermelon ENUKWatermelon ENUKYES

 

 

  • BA_Pete's avatar
    BA_Pete
    6 years ago

    Hi Anonymous ,

     

    Please try this calculation in your custom column:

    if List.IsEmpty(List.RemoveMatchingItems(Record.FieldValues(_), {"", null})) then "NA"
    else if [FRUIT LIST] = [FRUIT LIST_1] and
    [AREA CODE] = [AREA CODE_2] and
    [LANGUAGE] = [LANGUAGE_3] and
    [SALES CODE] = [SALES CODE_4]
    then "YES" else "NO"

     

    Pete 

19 Replies

  • Hi Anonymous ,

     

    When you say "Power BI formula", do you mean Power Query M code? If so, have you imported these tables into Power Query and what do they look like if you have?

     

    Pete

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks for your reply. Yes tge data are uploaded in power Bi. 

       

      The power BI formula : I mean by creating measure.

      what mean by Power query M code? Sorry I am new to power BI. Please explain. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        If possible to achieve my output through the conditional formatting (add column - - - conditional formatting)? Please advice.