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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Beginners M: How to Rename JSON Column and Format Date?

Hi All,
 
I'm new to the community and having some trouble with the syntax around pulling data within the M language.  I was hoping someone here may be able to assist.  I have a line of code that reads as follows:

 

DetailColumns = Table.ExpandRecordColumn(RecordsOfPage, "PageData",  {"Field1","Field2","Field3"}​

 

This pulls the 3 fields as expected.  However, I'm trying to understand how I would rename them, preferrable with a space (i.e. "Field1" shows as column "My Name").  And seperately, the data pulled out of one column is formatted as such: 2019-11-27T00:00:00.000.  I believe this is coming across as text.  I would like to ensure it is a proper date field and shorten it to MM/DD/YYYY.
 
If you could offer help with either topic it would be much appreciated!
 
Thank you so much.
-Brett
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

  • To rename just double click the column name and type in a new one.
  • To change the data type, click on the icon left to the column name and format it as date-time first, and later to date ( make sure you add the step not replace ) the date format should reflect your local settings MM/DD/YYYY should be as default if your windows setting are aligned.

image.png

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

  • To rename just double click the column name and type in a new one.
  • To change the data type, click on the icon left to the column name and format it as date-time first, and later to date ( make sure you add the step not replace ) the date format should reflect your local settings MM/DD/YYYY should be as default if your windows setting are aligned.

image.png

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

Anonymous
Not applicable

 

Thanks  @Mariusz for the tips.
 
I was looking for a way to do this in code and learned after your post that I could view the code being executed by your suggestion in Advance Editor.  That's awesome.  

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors