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
  • HobbyS's avatar
    3 years ago

    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.

  • FreemanZ's avatar
    3 years ago

    hi Aggro 

     

    try like:

    FORMAT(1, "00")

     

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