Forum Discussion
Concatenatex Lookupvalue multiple values
- 7 years ago
You can use CROSSFILTER function to get this column in Table1, if you have the aforesaid relationships
Country = CONCATENATEX ( CALCULATETABLE ( VALUES ( Table3[Country] ), CROSSFILTER ( Table2[Region], Table3[Region], BOTH ) ), [Country], "," )
Iamnvt
Actually above formula was for the case when there is no relationship.
It is a substitute for Lookupvalue
In case there is a relationship, it becomes simpler
Region_ = CONCATENATEX ( CALCULATETABLE ( VALUES ( Table2[Region] ) ), [Region], "," )
Really nice!!!
I have a bit more complex scenarios. I have another Table 3, that has the mapping between Region, and Country:
RegionCountry
| AA | a |
| BB | b |
How can I transverse the Country from Table 3 to Table 1 directly?
I know that I can transverse from Table 3 to Table 2 first, then Table 2 to Table 1. Just curious to know if any better way.
Expected Results:
| Product | Region | Country |
| A | AA, BB | a, b |
| B | BB | b |
| C | CC |
PBI file here:
- Zubair_Muhammad7 years agoCommunity Champion
You can use CROSSFILTER function to get this column in Table1, if you have the aforesaid relationships
Country = CONCATENATEX ( CALCULATETABLE ( VALUES ( Table3[Country] ), CROSSFILTER ( Table2[Region], Table3[Region], BOTH ) ), [Country], "," ) - Zubair_Muhammad7 years agoCommunity Champion
Another way could be to use TREATAS
Country2 = CONCATENATEX ( CALCULATETABLE ( VALUES ( Table3[Country] ), TREATAS ( CALCULATETABLE ( VALUES ( Table2[Region] ) ), Table3[Region] ) ), [Country], "," )or to use INTERSECT function
Country 3 = CONCATENATEX ( CALCULATETABLE ( VALUES ( Table3[Country] ), INTERSECT ( VALUES ( Table3[Region] ), CALCULATETABLE ( VALUES ( Table2[Region] ) ) ) ), [Country], "," )