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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Islam
Helper V
Helper V

A help with lookup table in power query

Hello Experts
i have a big problem and i can't solve it
i have a table that contains grade for each employee and a table which contains the grades ( fair , good , very good , excellent) and the lower and the upper limit for each category i wanna return each equivalent grade category text for each employee by filtering categories table by each employee grade for each row in student grades table filtering lower and upper limit
 
 
 
9 REPLIES 9
PhilipTreacy
Super User
Super User

@Islam 

I think you could do this with just an IF statement and not need a 2nd table with grades.

Please post some sample data, too hard to give an accurate solution without it.

regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Didn't think about that 

i'll try this out and inform you of the result sir

ChrisMendoza
Resident Rockstar
Resident Rockstar

@Islam -

I tried to learn something new with @ImkeF solution at https://www.thebiccountant.com/2018/02/15/generic-switch-function-query-editor-in-power-bi-and-power... however, I failed trying to do a comparative operator; see [Custom] (Maybe ImkeF can show us how to do it with her nifty function). Then I found https://community.powerbi.com/t5/Desktop/How-to-lookup-values-in-another-table-in-the-Query-Editor/t... which produced:

image.pngimage.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Unfortunately that's not what i meant sir 

i have 2 tables 

one fact table with all employees transactions including secret report degree 

and another disconnected table with grade defined name ( fair - good - very good - excellent) and every grade have a range of lower and upper limit of grade 

what i want is add column in the fact table doing the following:

look up each single employee degree in the whole limits for each category  ( fair - good - very good - excellent) in the disconnected table and return the matching grade title into that added column in the fact table

Thanks for help sir but unfortunately it doesn't help coz i have a table with lower limit column and upper limit column for each category

@Islam - You don't need min/max limits as you can see in my sample. The operator acts like the rules of min/max "organically". Try it with your existing data [Max] and see if it produces the results you intend.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Ok I'll apply this and see what happens and inform you about it

Hey @Islam,

 

please create a pbix that contains sample data but still reflects your data model. Upload the pbix to onedrive or dropbox and share the link. If you are using Excel to create the sample data and share xlsx as well.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

I'm using power query and power pivot for excel but np I'll upload a sample and provide you with the link

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.