Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Create a new column based on multiple conditions

Hi,   I need to create a new column called 'Score' based on the below example:   Condition: If Type = "V", Actual/Target % = 67% which is >=50 && <=75%, then give me V Score = 25,  please look at...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Anonymous 

     

     

    1. Create them as 2 different tables. Let me call the first table as Table1.

     

    2. For the second Table I would create it with columns Min%, Max%, MScore, Vscore

     

    eg         0,50,0,0

                 51,75,500,25

                 76,90,1000,200

                 91,100,2000,300

     

    3. Now we want to add the Vscore from table2 as score in table1 based on the condition.

     

    4. Crate a calculated column Vscore in Table1 with the expression 

     

        

             CALCULATE (
                           VALUES ( Table2[Vscore] ),
                                FILTER (
                                          Table2,
                                          Table1[Actual/Target%]  >= Table2[Min%]
                                         && Table1[Actual/Target%] <= Table2[Max%]
                                       )
                        )
     

    This will get the Vscore against each row value of Table1[Actual/Target%]

     

    Cheers

     

    CheenuSing