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.
Hi there datanauts,
I have a very hard question that has consumed many hours.
I have table of values (~10,000).
I need to get one corresponding value from a lookup table.
The looktable has a series of values for each scenario with differing levels of specificity.
I.e there will be:
A general value for Jim
There might also be:
A rule if Jim and Origin = "NZ"
And an even more specific rule for:
If Jim and NZ and product number is between 330 and 450
I actually have about 5 levels of specifity in the rules.
In this example, I would need to look up a product of:
Name: Apple, Picked: Jim, Origin: NZ Product Number: 441.
If a value can't be found with the exact requirements, it should drop the product number and try again, then the origin and try again, then the picked and try again.
I could achieve this with a series of merges. I can do my dataset in 6 merges (when I filter down the dataset) but with the size of the full dataset it's taking hours to calculate.
I've also tried sorting my table from most specific rules to least specific then writing a function to get the lookup table, filter by each specification (e.g, Origin = "NZ or Origin = "Blank"), then use list.first to bring back the top result. This works and is marginally faster but still can't handle the entire dataset.
I've also taken to shrinking my lookup table first to ensure if only has values and are included in the data.
I feel like there's an easy solution somewhere. Can I use wildcards in powerbi then only bring back the first result it finds?
Any help is much much appeciated,
Mike
Main Table
@Anonymous ,
You may also try DAX.
https://community.powerbi.com/t5/Desktop/Lookup-Price-Range-for-Style/m-p/322514#M143719
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
97 | |
79 | |
67 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |