Forum Discussion
undefined
The FORMAT function for date is returning the date on Dd-MM-YYYY instead of Month when given
Column = FORMAT( CONTRACT[CONTRACT_DT,"DDDD"])
v-kpoloju-msft Thanks for checking It started working when I have given the correct the given format.Thanks FBergamaschi
8 Replies
- FBergamaschiSuper User
The syntax you mention
Column = FORMAT( CONTRACT[CONTRACT_DT,"DDDD"])
Cannot work
In case
Column = FORMAT( CONTRACT[CONTRACT_DT],"DDDD")
But you want the month so
Column = FORMAT( CONTRACT[CONTRACT_DT,"mm"])
If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- D_BinduMadhaviRegular Visitor
FBergamaschi ,Thank you very much for your reply. I have tried the above format as well, its returing the exact date in the new column instead of returning month when given MM and day when DDDD is given....! Is there any settings that I can do in my BI tool for my FORMAT function to work properly?
- FBergamaschiSuper User
Can you please share the pbix via some cloud service and post the link here (or in a private message) so I check the issue?
Please mention me or I los the thread
Thanks
If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
- v-kpoloju-msftCommunity Support
Hi D_BinduMadhavi,
Thank you for reaching out to the Microsoft fabric community forum. Also, thanks to FBergamaschi, for his inputs on this thread.
You are very close, "DDDD" actually returns the day of week (like Monday), not the month. To show the month name, use "MMMM" (full) or "MMM" (abbreviation).
For example: Month Name = FORMAT(CONTRACT[CONTRACT_DT], "MMMM")
If you also add Month No = MONTH(CONTRACT[CONTRACT_DT]), you can sort Month Name by Month No (Modelling → Sort by column) so months appear Jan–Dec instead of alphabetically. Please also double check that CONTRACT[CONTRACT_DT] is a Date/DateTime column FORMAT expects a real date for best results.
Refer this link for more information: https://learn.microsoft.com/en-us/dax/format-function-dax
Hope this helps. If you have any doubts regarding this, please feel free to ask here. We will be happy to help.
Thank you for using the Microsoft Community Forum.- v-kpoloju-msftCommunity Support
Hi D_BinduMadhavi,
Just checking in to see if the issue has been resolved on your end. If the earlier suggestions helped, that’s great to hear! And if you’re still facing challenges, feel free to share more details happy to assist further.Thank you.
- D_BinduMadhaviRegular Visitor
v-kpoloju-msft Thanks for checking It started working when I have given the correct the given format.Thanks FBergamaschi