Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Trying to create a new custome Column called MthNum for the current month.
So if it's April 10, 2023 the value returned would be 4. If it's Nov 22, 2024 it would return 11, and so on. For Today's date, ie... when the user is using the system.
Hi @Dbuck44 ,
You can use the Month function to accomplish this:
Something like below- edit to fit your table and column names.
ColumnName= MONTH(Table[Datefield])
Here is some additional information
https://learn.microsoft.com/en-us/dax/month-function-dax
You can also create a measure to get the month of today's date like so:
Please consider accepting as solution if this has answered the question.
I,m using the "Transform Data" in Power Query editor. Selecting "Add Custom Column". It's not accepting this new measure. Is this a syntax issue?
Hi @Dbuck44 ,
I helped you move your post to the Power Query forum.
And you can add the custom column as follows. It will return the Month number.
= Date.Month([Date])
And the following will return the month name.
= Date.MonthName([Date])
And if you also want to return the month number of totay, chech this.
= Date.Month(DateTime.Date(DateTime.LocalNow()))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
35 | |
17 | |
12 | |
11 | |
9 |
User | Count |
---|---|
45 | |
27 | |
16 | |
14 | |
14 |