Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I need to convert the current date to text so i can join it to a string.
let
Source = DateTime.LocalNow(),
Text = DateTime.ToText(Source)
in
TextI have this, but the output is 09/09/2022 12:31:23 and I need 2022-09(MONTH)-09(DAY)
How can I solve this ?
Solved! Go to Solution.
Change DateTime.ToText(Source) to
DateTime.ToText(Source,"yyyy-MM-dd")
Depending on exactly what you want, maybe:
DateTime.ToText(DateTime.LocalNow(),"yyyy-MM(MMMM)-dd(dddd)")
=> 2022-09(September)-09(Friday)
or
DateTime.ToText(DateTime.LocalNow(),"yyyy-MM(""MONTH"")-dd(""DAY"")")
=> 2022-09(MONTH)-09(DAY)
here, today.
Depending on exactly what you want, maybe:
DateTime.ToText(DateTime.LocalNow(),"yyyy-MM(MMMM)-dd(dddd)")
=> 2022-09(September)-09(Friday)
or
DateTime.ToText(DateTime.LocalNow(),"yyyy-MM(""MONTH"")-dd(""DAY"")")
=> 2022-09(MONTH)-09(DAY)
here, today.
Change DateTime.ToText(Source) to
DateTime.ToText(Source,"yyyy-MM-dd")
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 10 | |
| 6 | |
| 5 | |
| 4 | |
| 2 |