Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a table with data as below (representative only):
| ID | Organism | Organism type | Country |
| 1001 | A | plant | USA |
| 1001 | A | plant | Canada |
| 1001 | A | plant | Mexico |
| 1002 | B | insect | Germany |
| 1002 | B | insect | France |
| 1003 | C | bacteria | China |
| 1004 | D | virus | Australia |
and I want to display a table combining the countries rows so that there is only one entry for each ID, as so:
| ID | Organism | organism type | Country |
| 1001 | A | plant | USA, Canada, Mexico |
| 1002 | B | insect | Germany, France |
| 1003 | C | bacteria | China |
| 1004 | D | virus | Australia |
I need to do this using DAX and not in PowerQuery because there is a different part of the report where the countries do need to be separate.
I am trying to write a measure but can't get it to work. I've tried using various combinations of concateneatex, combinevalues, calculate, filter, selectcolumns... but the closest I've gotten is for it to spit out a one row table listing all countries without regard to the ID, like this:
| ID | Organism | Organism type | Country |
| Total | USA, Canada, Mexico, Germany, France, China, Australia |
I tried to modify this solution https://community.fabric.microsoft.com/t5/Desktop/Concatenate-text-stored-in-several-rows/m-p/319615... like so:
CALCULATE(CONCATENATEX('Table','Table'[Country]," "),FILTER('Table','Table'[ID]=EARLIER('TABLE'[ID]))
but the EARLIER formula is giving an error.
This feels like it should have a simple solution but I can't crack it, thanks!
Solved! Go to Solution.
@Anonymous , just create a measure like
CONCATENATEX('Table','Table'[Country]," ")
for the column you need
CONCATENATEX(FILTER('Table','Table'[ID]=EARLIER('TABLE'[ID]),'Table'[Country]," ")
@Anonymous , just create a measure like
CONCATENATEX('Table','Table'[Country]," ")
for the column you need
CONCATENATEX(FILTER('Table','Table'[ID]=EARLIER('TABLE'[ID]),'Table'[Country]," ")
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 66 | |
| 48 | |
| 43 | |
| 26 | |
| 19 |
| User | Count |
|---|---|
| 198 | |
| 126 | |
| 102 | |
| 67 | |
| 50 |