Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

approximate match lookupvalue

Hello,

 

How do I get a Rating in Table 2 using lookupvalue with the data sets I have in table 1.

 

boycoronacion21_0-1670743822967.png

boycoronacion21_1-1670743855451.png

 

Thanks in advance!

3 ACCEPTED SOLUTIONS
mangaus1111
Solution Sage
Solution Sage

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.

View solution in original post

Anonymous
Not applicable

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. 

View solution in original post

Anonymous
Not applicable

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

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

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
Not applicable

Hello @Xiaoxin,

 

Appologies for the confusion. I mean the range of the rating in Table 2 might change in the future and we don't want that affect the historical data if we're using switch dax. For example next month it might change to, 5 = (100%), 4 = (<100%-97%), 3 = (<97%-94%) and so on.

 

Regards,

Boy Coronacion

Anonymous
Not applicable

HI @Anonymous,

You can refer to the following blog to create a dynamic segmentation table and write ranking formula based on this table definition.

These ranking results will also automatically changes when you modify the segmentation table ranges.

Dynamic segmentation – DAX Patterns
Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Sure, I'll check on this one. But it seems we still don't have the approximate match function like in Vlookup in excel. Thank you!

Anonymous
Not applicable

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

mangaus1111
Solution Sage
Solution Sage

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.