Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
krishna_murthy
Frequent Visitor

How to get month Number In DAX

Hi Team,

 

Here is the question 

IF(Jan =01,
(Feb= 02,
(Mar=03.
.
..
..
Dec=12))))))

 

Please check how we can achieve on the DAX measaure 

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1742709368592.png

 

 

month number CC =
FORMAT (
    CONVERT (
        YEAR ( TODAY () ) & "-" & 'month'[month name] & "-"
            & DAY ( TODAY () ),
        DATETIME
    ),
    "mm"
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Hi @krishna_murthy ,

I hope the provided information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you

View solution in original post

4 REPLIES 4
v-menakakota
Community Support
Community Support

Hi @krishna_murthy  ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

Thank you.

Hi @krishna_murthy ,

I hope the provided information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.

Thank you

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1742709368592.png

 

 

month number CC =
FORMAT (
    CONVERT (
        YEAR ( TODAY () ) & "-" & 'month'[month name] & "-"
            & DAY ( TODAY () ),
        DATETIME
    ),
    "mm"
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Deku
Super User
Super User

If you have a date you can extract with

 

month( table[date])

 

Otherwise you will have to use 

 

Switch(

Selectedvalue( table[month name])

,"Jan", 1,

....

)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.