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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
_Regina
Helper I
Helper I

CONCATENATE works fine with only numeric but as soon as I concatenate symbol it is spinning wheels

Hi everyone,

What I am trying to do is- I have dates like 20230517 I want to display it like 2023-05-17

 

I have created the following measure

 

_Referral_date_formatted =
var a=SELECTEDVALUE('Onboarding Requests'[REFERRAL_DATE_DIM_SYSID])
var year_ = LEFT(a,4)
var month_ = RIGHT(LEFT(a,6),2)
var day_ = RIGHT(a,2)
return CONCATENATE(CONCATENATE(CONCATENATE( CONCATENATE(year_ ,"-"),month_),"-"),day_)
It is taking forever.
 
but when I try to return this
return CONCATENATE( CONCATENATE(year_ ,month_),day_) -- this works fine
 
 
I have kept the Data type of the measure as Text. any guidance here as to why adding the symbol is taking forever...
 
 
1 ACCEPTED SOLUTION

Date = 
var d = SELECTEDVALUE('Table'[DateText])
return Left(d,4) & "-" & mid(d,5,2) & "-" & RIGHT(d,2)

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @_Regina ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

Table = ADDCOLUMNS(DATATABLE("DateText",STRING,{{"20230517"}}),"Date",DATE(Left([DateText],4),mid([DateText],5,2),RIGHT([DateText],2)))
 
lbendlin_0-1715976921839.png

 

Use FORMAT([date],"yyyy-MM-dd")  for the UI.

Still does not work, I have to do it via measure. and then I am creating a table visual where I am pulling in all the recirds so that users can see the relevant data, it is just that dates like 20230715 is not user friendly, I just want it to display differently in the table visual, The limitation is that I cannot create a new column.

 

 

_Regina_0-1715978945809.png

 

Date = 
var d = SELECTEDVALUE('Table'[DateText])
return Left(d,4) & "-" & mid(d,5,2) & "-" & RIGHT(d,2)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.