Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

approximate match lookupvalue

Hello,   How do I get a Rating in Table 2 using lookupvalue with the data sets I have in table 1.     Thanks in advance!
  • mangaus1111's avatar
    3 years ago

    Hi Anonymous ,

    why don´t you use function SWITCH, instead of LOOKUPVALUE?

     

    SWITCH(TRUE(),
                 'Table1'[Attendence] < 0,9, 1,
                 'Table1'[Attendence] < 0.95, 2,
                  Table1'[Attendence] < 0.98, 3,
                 Table1'[Attendence] < 1, 4,
                  5
    )

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Thank you mangaus1111 for the solution. Yes this works.

    I'm using lookupvalue since the rating might change the next month and I don't want the historical rating to be affect by the switch Dax. Do we have solution to that? Appreciate your help. 

  • Anonymous's avatar
    Anonymous
    3 years ago

    HI Anonymous,

    Did you mean these new records will be added to the current table and affect the ranking? If that is the case, current power bi does not exist historical data feature. You may need to export to the current records with ranking to keeping results.

    Regards,

    Xiaoxin Sheng