Forum Discussion
Date formatting in wrong way when converted to text
- 1 year ago
Hi UIUser ,
The issue occurs because when you concatenate a date with text in DAX, Power BI implicitly converts the date to a string using the default US format (MM/DD/YYYY), ignoring your regional settings. This happens even if your system or file is configured for German formatting. To fix this, you need to explicitly format the date before concatenation. Use the FORMAT function to define the correct European date structure. For example, instead of relying on SELECTEDVALUE to output a date directly, wrap it like this:
header_ertragleer_previous_month = "Ertrag leer per " & FORMAT(SELECTEDVALUE('bm dim_month'[month_end]), "DD.MM.YYYY")This ensures the date appears as 31.01.2025 regardless of Power BI’s internal preferences. If you want to reinforce the language tag just in case, use the following format string:
header_ertragleer_previous_month = "Ertrag leer per " & FORMAT(SELECTEDVALUE('bm dim_month'[month_end]), "[$-de-DE]dd.mm.yyyy")This forces the German locale format and avoids any surprises when the report is opened elsewhere.
Best regards,
Hi UIUser ,
Thanks for reaching out to the Microsoft fabric community forum.
As mentioned by DataNinja777 , I tried to implement their suggestion and it has successfully worked at my end
Give this a try it will most likely resolve the issue.
Furthe Reading: SELECTEDVALUE function - DAX | Microsoft Learn
FORMAT function (DAX) - DAX | Microsoft Learn
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you