This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello.
I have a dataflow in the power BI Service. There is a date column (Date) which needs to be as a text data type (dont ask why) and needs to be in a specific format.
Currently the date column is in the dd/mm/yyyy format.
I need to change this so its in the yyyy-MM-dd format , but as a string.
I have added the following code
Solved! Go to Solution.
Try this: Table.TransformColumns(Navigation, {{"YYYY-MM-DD", each Date.ToText(_, "yyyy-MM-dd"), type text}}) and see if this solves your problem
Proud to be a Super User!
Yes it's possible. Please try this:
Table.TransformColumns(Navigation, {[#"Date"], each Date.ToText(_, "yyyy-MM-dd")})
Instead of "Table.AddColumn(Navigation, "Custom", each Date.ToText([#"Date"], "yyyy-MM-dd"))"
Proud to be a Super User!
Whilst visually, this looks correct, i just tried it and it gives me this error :
Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?
I use tha name of my column Date where I want to transform.
Probably the error is on the [#"Date"]. Replace this column name for your column date name.
Proud to be a Super User!
I did that. My date column is called Y-M-D.
This is the code i am using
Try this: Table.TransformColumns(Navigation, {{"YYYY-MM-DD", each Date.ToText(_, "yyyy-MM-dd"), type text}}) and see if this solves your problem
Proud to be a Super User!
Thank you so much. That worked
Hi,
Try this code:
Date.ToText([Date], "yyyy-MM-dd")
Proud to be a Super User!
Thanks. That worked.
Do you know how i can alter the existing M code - so we dont create a new column
At the moment i have this M code
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 38 | |
| 28 | |
| 27 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 37 | |
| 32 | |
| 25 | |
| 25 |