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
Hi
I am looking to get the month number and the year when referening a date field
However, when trying to use Month() or Format () it doesnt allow me to use the Date field
I want to get the month number and year from the data column - which will allow me to create a reference of Year * 12 + month number
Any Suggestions ?
| customer | due-date | Month Number | Year | Reference | Calculation |
| 1001 | 28/02/2023 | 2 | 2023 | 24278 | =(D2*12)+C2 |
| 1001 | 31/03/2023 | 3 | 2023 | 24279 | |
| 1001 | 31/03/2022 | 3 | 2022 | 24267 | |
| 1001 | 30/04/2022 | 4 | 2022 | 24268 | |
| 1001 | 30/06/2022 | 6 | 2022 | 24270 | |
| 1001 | 31/08/2022 | 8 | 2022 | 24272 |
Thank you
I regularly use the following DAX from SQLBI to create a Date Table. Highlighted in the code are the 2 items you are looking for:
- Year
- Month Number
Hope this is helpful to you.
Regards,
Nathan
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 |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |