Forum Discussion
GROUP BY calculated column
- 8 years ago
May be
Calculated_Column = VAR InvoiceNo = [Invoice No] RETURN CONCATENATEX ( FILTER ( Sales, Sales[Invoice No] = InvoiceNo ), Sales[Salesperson], ", " ) - 8 years ago
Zubair_Muhammad thanks for looking into this, this works, but coming up with duplicates. Is there a way to suppress duplicates?
Anonymous I have the data in seperate columns as indicated in my example above, in a spreadsheet. There is no delimiter like in a csv.
Ok, so you are trying to create the last column, its not part of your initial dataset.
Here is some dax code that should be close to what you are looking for. You might need to add more variables if you have more constraints on what to be placed on which lines a sales persons name gets placed on.
Calculated Column = var InvoiceNo = [Invoice No]
RETURN
CONCATENATEX(
CALCULATE(
DISTINCT('YourTable'[SalesPerson]),
ALL('YourTable'),
'YourTable'[Invoice No] = InvoiceNo
),
[SalesPerson],
", "
)- ek21128 years agoAdvocate II
Anonymous Thanks, I tried with the measure, but I get an error "table of multiple values was supplied where a single value was expected". Here is the sample pbix.
- Zubair_Muhammad8 years agoCommunity Champion
May be
Calculated_Column = VAR InvoiceNo = [Invoice No] RETURN CONCATENATEX ( FILTER ( Sales, Sales[Invoice No] = InvoiceNo ), Sales[Salesperson], ", " )- ek21128 years agoAdvocate II
Zubair_Muhammad thanks for looking into this, this works, but coming up with duplicates. Is there a way to suppress duplicates?