Forum Discussion

Aggro's avatar
Aggro
Frequent Visitor
3 years ago
Solved

DAX Month Format Function

Hi

I want to format the month with two digits by using the FORMAT function, but the result wasn't expected. 

 

 

DAX:  FORMAT ( 1 , "MM")  

Result:  12

 

The result I expected should be  01

  • You have to put in a [Date] instead of 1. Example:

    =FORMAT(DATEVALUE("30.11.2023");"MM")

    You will get 11 for the month-Number.

  • hi Aggro 

     

    try like:

    FORMAT(1, "00")

     

    you get 12, because DAX take 1 as 1899/12/31, so it returns 12

     

2 Replies

  • HobbyS's avatar
    HobbyS
    Regular Visitor

    You have to put in a [Date] instead of 1. Example:

    =FORMAT(DATEVALUE("30.11.2023");"MM")

    You will get 11 for the month-Number.

  • hi Aggro 

     

    try like:

    FORMAT(1, "00")

     

    you get 12, because DAX take 1 as 1899/12/31, so it returns 12