Forum Discussion
How to copy values and concatenate based on cell values?
- 1 year ago
Hi dguibert ,
You can achieve this using Power BI's DAX with a calculated column and a bit of row context logic. Since you're working in the table view and not in Power Query, here's a way to do it:
Try adding a calculated column like this:
Result Desired = VAR CurrentProject = [PROJECT] VAR CurrentAsset = [ASSET] RETURN CALCULATE( CONCATENATEX( FILTER( 'YourTable', 'YourTable'[PROJECT] = CurrentProject && 'YourTable'[Index] <= EARLIER('YourTable'[Index]) ), 'YourTable'[ASSET], ", " ) )Important: You’ll need an Index column to preserve row order. You can add it in Power BI using "Add Index Column" in Power Query before loading the data.
This will concatenate the assets for each project up to the current row, giving you the cumulative list you're looking for.
Let me know if you need help adapting this to your exact table name or structure.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
This response was assisted by AI for translation and formatting purposes.
- 1 year ago
If you cannot access the query editor at all, either to do this in M or to add an index, you can try something like this as a calculated column...
Result = var _project = [PROJECT] var _vTable = SUMMARIZE( assetTable, assetTable[PROJECT], "__value", CONCATENATEX(DISTINCT(assetTable[ASSET]), [ASSET], ", ") ) RETURN MINX( FILTER(_vTable, [PROJECT] = _project), [__value] )It should look like this...
If you cannot access the query editor at all, either to do this in M or to add an index, you can try something like this as a calculated column...
Result =
var _project =
[PROJECT]
var _vTable =
SUMMARIZE(
assetTable,
assetTable[PROJECT],
"__value", CONCATENATEX(DISTINCT(assetTable[ASSET]), [ASSET], ", ")
)
RETURN
MINX(
FILTER(_vTable, [PROJECT] = _project),
[__value]
)
It should look like this...
- dguibert1 year agoFrequent Visitor
Whoa! Solved it right away after 3 hours of trying to find out on my own. You saved my day, Thanks!