This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I have 2 table which I cannot merge due to granularity:
This is the main:
And this is the other:
So wanted to merge them on country and then get category in the main table.
Looked liked it worked but then I noticed my lines got doubeld.
Most likely because the main table has Business and therefore the country is in for every business.
I could add business to the lookup table but then I would always be doing double maintenance if new countries were in scope.
Was thinking of not merging but just do a lookup from the main table into the lookup tabel and then get category from the lookup table in my custom column in the main table.
What would the M-code be for something (simple) like this?
Solved! Go to Solution.
Ok I was able to find a solution found in a power query video explaining this.
Would think it would be easier, not that it is hard but it looks more like a workaround.
= #"*V* Category"[Category]{List.PositionOf(#"*V* Category"[Country],[Country])}
Looking first up where the poistion is of the category
x = List.PositionOf(#"*V* Category"[Country],[Country])
and than use that to get the actual category...
- #"*V* Category"[Category]{ x }
Maybe there are better and easier solutions for when merge doesn't work but I will go with this for now 🙂
Ok I was able to find a solution found in a power query video explaining this.
Would think it would be easier, not that it is hard but it looks more like a workaround.
= #"*V* Category"[Category]{List.PositionOf(#"*V* Category"[Country],[Country])}
Looking first up where the poistion is of the category
x = List.PositionOf(#"*V* Category"[Country],[Country])
and than use that to get the actual category...
- #"*V* Category"[Category]{ x }
Maybe there are better and easier solutions for when merge doesn't work but I will go with this for now 🙂
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 37 | |
| 32 | |
| 27 | |
| 24 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 50 | |
| 31 | |
| 26 | |
| 22 |