Forum Discussion

mibu's avatar
mibu
Microsoft Employee
7 years ago
Solved

Add additional column to a .pbix file

Hello Power BI Community,

 

Pls see Test Case.pbix, access via following link:

 

Link to .pbix file

 

In it, I have added a column called, "Key" that analyzes each line item and assigns it either "Key" or "Not Key" based on values contained under Criteria A, B and C.

 

I would like to add a second column called, "Key2" that analyzes each line of data and assigns it "Key" if it matches the very same parameters as "Key" OR if the line item contains a "W" under Criteria D, else "Not Key".

 

Thanks so much and look forward to your feedback regarding the edit to formula that will get me there.

 

mibu

  • Ok, so if the column "Key" has the value key, or if column "Criteria D" has value W, then the new colum should assign the value Key.

     

    Try this.

    Key2 = IF(OR(data[Key]="key";data[Criteria D]="W");"Key";"Note Key")
     
    Hope this will help. :-)

2 Replies

  • Thim's avatar
    Thim
    Resolver V

    Ok, so if the column "Key" has the value key, or if column "Criteria D" has value W, then the new colum should assign the value Key.

     

    Try this.

    Key2 = IF(OR(data[Key]="key";data[Criteria D]="W");"Key";"Note Key")
     
    Hope this will help. :-)
    • mibu's avatar
      mibu
      Microsoft Employee

      Hey Thim, thanks for the input.  Following all the logic for "Key", the first set of conditions, with "or" in its own line, followed by the second condition, worked like a charm.  Thanks and best, mibu.