Forum Discussion
how do I change date format in CONCATENATEX
Without knowing what your Dates table looks like, you can try something like:
Measure = VAR _MMMYYTable = SUMMARIZE( GENERATE( Dates, ROW( "label", FORMAT( Dates[Date], "MMMYY" ) ) ), [label] ) VAR _concat = CONCATENATEX( _MMMYYTable, [label], ", " ) RETURN _concatNote that if you add a column to your Dates table with the text you want, e.g. a [MMMYY] column, then _MMMYYTable = VALUES ( Dates[MMMYY] ) could be used instead of the SUMMARIZE/GENERATE
6 Replies
- MarkLaf
Super User
Without knowing what your Dates table looks like, you can try something like:
Measure = VAR _MMMYYTable = SUMMARIZE( GENERATE( Dates, ROW( "label", FORMAT( Dates[Date], "MMMYY" ) ) ), [label] ) VAR _concat = CONCATENATEX( _MMMYYTable, [label], ", " ) RETURN _concatNote that if you add a column to your Dates table with the text you want, e.g. a [MMMYY] column, then _MMMYYTable = VALUES ( Dates[MMMYY] ) could be used instead of the SUMMARIZE/GENERATE
- bsz412
Helper III
Thanks so much, both versions you provided work perfectly! Awesome!
- amitchandak
Super User
bsz412 , Try like
CONCAT TEST =
CONCATENATEX(
VALUES(AW_Calendar_Lookup[Date].[Month]),
format(AW_Calendar_Lookup[Date], "MMMM"),
","
)- bsz412
Helper III
it gives the following error message
A single value for column 'Date' in table 'AW_Calendar_Lookup' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation su
- amitchandak
Super User
bsz412 , Sorry, Try this
CONCAT TEST =
CONCATENATEX(
VALUES(AW_Calendar_Lookup[Date].[Month]),
format(max(AW_Calendar_Lookup[Date]), "MMMM"),
","
)