Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
bsz412
Helper III
Helper III

how do I change date format in CONCATENATEX

Hi, 
 
I would need to create a list on a card which shows the months I chose from a slicer, in this format: 
Example: 
Jan21, Feb21, Mar21, Apr21  
With the following code I could create something similar, but it gives me only month names, so not exactly what I need. 
 
CONCAT TEST =
CONCATENATEX(
VALUES(AW_Calendar_Lookup[Date].[Month]),
AW_Calendar_Lookup[Date].[Month],
","
)
Result: January, February, March, April
 
Can you please help me how to produce the required format?
thank you
 
1 ACCEPTED SOLUTION
MarkLaf
Super User
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
_concat

 

MarkLaf_0-1645120520126.png

Note 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

View solution in original post

6 REPLIES 6
MarkLaf
Super User
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
_concat

 

MarkLaf_0-1645120520126.png

Note 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

Thanks so much, both versions you provided work perfectly! Awesome!

 

 

 

amitchandak
Super User
Super User

@bsz412 , Try like

 

CONCAT TEST =
CONCATENATEX(
VALUES(AW_Calendar_Lookup[Date].[Month]),
format(AW_Calendar_Lookup[Date], "MMMM"),
","
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

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

@bsz412 , Sorry, Try this

 

CONCAT TEST =
CONCATENATEX(
VALUES(AW_Calendar_Lookup[Date].[Month]),
format(max(AW_Calendar_Lookup[Date]), "MMMM"),
","
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

The problem with this one is that it repeats the MAX value like :

August, August, August, August

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors