Forum Discussion
Add category based on a second table
Hello!
I am new to Power Query and I am having some trouble with a task. Could anyone give me some advice?
Basicaly, I have Table.1 with products and their relative volume, and Table.2 with categories associated to "volume ranges". I want to associate those categories to the products, as in Table.3.
I checked the possibility of using bucket function, but I don't think it will work because Table.2 ranges can change and I need a fast way to update the categories.
Thanks!!
Table.1
| Product | Volume |
| p1 | 8 |
| p2 | 15 |
| p3 | 16 |
| p4 | 25 |
| p5 | 50 |
Table.2
| Category | min vol | max vol |
| A | 0 | 10 |
| B | 10 | 20 |
| C | 20 | 30 |
| other | 30 | 100 |
Table.3
| Product | Volume | Category |
| p1 | 8 | A |
| p2 | 15 | B |
| p3 | 16 | B |
| p4 | 25 | C |
| p5 | 50 | other |
Hi, Anonymous
Please check the below picture and sample pbix file's link down below, whether it is what you are looking for.
All measures are in the sample pbix file.
https://www.dropbox.com/s/wdv3hmwdgz2yfkb/matheuswu.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: https://www.linkedin.com/in/jihwankim1975/
2 Replies
- Jihwan_KimSuper User
Hi, Anonymous
Please check the below picture and sample pbix file's link down below, whether it is what you are looking for.
All measures are in the sample pbix file.
https://www.dropbox.com/s/wdv3hmwdgz2yfkb/matheuswu.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: https://www.linkedin.com/in/jihwankim1975/- AnonymousNot applicable
That's it! Thank you very much!