Using the AdventureWorks dataset, I need to create the following report in Power BI: First column has CustomerKey, second column Total Sales of this customer, and third column the distinct concatenation of the names of the months when that customer made a purchase.
For the last column, I have the following DAX measure:
Months when sales happened = CONCATENATEX(VALUES(Sales[OrderDate].[Month]), Calendar[MonthName])
With VALUES() I get the distinct list of months where the customer made the purchase, and Calendar[MonthName] returns the month name. Last, CONCATENATEX concatenates the names of the months.
The error I get in the measure is:
A single value for column 'MonthName' in table 'Calendar' cannot bedetermined. This can happen when a measure formula refers to a columnthat contains many values without specifying an aggregation such asmin, max, count, or sum to get a single result.
How to make this work?