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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Date formats in Excel

Hi,

 

I have an Excel datasheet as below

 

AXIS201801312342.35
AXIS2018022834124.24
AXIS201803318940.25721
AXIS201804308950.96969
AXIS201805318958.45176
AXIS201806308966.02628
AXIS201807318973.26532
AXIS201808318980.64236
AXIS201809308987.12596
AXIS201810318994.45493
AXIS201811309001.23626
AXIS201812319010.17852
AXIS201901319014.45574
AXIS201902289015.25834
AXIS201903319015.93442
AXIS201904309016.7537
AXIS201905316561.219
AXIS201906306562.019
AXIS201907316694.358
AXIS201908316629.351
AXIS201909306609.2
AXIS201910316589.75
AXIS201911306583.197
AXIS201912316638.637
AXIS202001318940.25721
AXIS202002298950.96969
AXIS202003318958.45176
AXIS202004308966.02628
AXIS202005318973.26532
AXIS202006308980.64236
AXIS202007318987.12596

 

My output table need to be like this:

 

AXIS31/07/2020Current Month
AXIS30/06/20201 month
AXIS31/05/20202 month
AXIS30/04/20203 month
AXIS31/03/20204 month
AXIS29/02/20205 month
AXIS31/01/20206 month
AXIS31/12/20197 month
AXIS30/11/20198 month
AXIS31/10/20199 month
AXIS30/09/201910 month
AXIS31/08/201911 month
AXIS31/07/20191 year
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS31/07/20182 years
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  
AXIS  

 

 

Any help is greatly appreciated..

 

ara

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

try to create two columns

Date = date(LEFT('Table'[Column2],4),mid('Table'[Column2],5,2),RIGHT('Table'[Column2],2))

Month = 
VAR mth=DATEDIFF('Table'[Date],max('Table'[Date]),MONTH)
return if(mth=0,"CurrentMonth",if(mth/12<1,mth&" month",if(mth/12<2,"1 year",int(mth/12)&" years")))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ryan_mayu
Super User
Super User

@Anonymous 

try to create two columns

Date = date(LEFT('Table'[Column2],4),mid('Table'[Column2],5,2),RIGHT('Table'[Column2],2))

Month = 
VAR mth=DATEDIFF('Table'[Date],max('Table'[Date]),MONTH)
return if(mth=0,"CurrentMonth",if(mth/12<1,mth&" month",if(mth/12<2,"1 year",int(mth/12)&" years")))

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




dedelman_clng
Community Champion
Community Champion

Hi @Anonymous  - can you elaborate on what your data is and what specifically you are trying to do?  Also see here for pointers on how to get the best responses when you post a question: How to Get Your Question Answered Quickly 

 

David

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.