Forum Discussion

FlyBoyNight's avatar
FlyBoyNight
New Member
6 years ago
Solved

Direct Query - 2 Digit Month Insanity

Hi everyone,   Really new to Power BI and Dax, so thanks in advance!   I'm trying to get 2 digit month using Dax and Direct Query.  Ultimately, I am trying to order data visuals correctly, using ...
  • Stachu's avatar
    Stachu
    6 years ago

    YEAR and MONTH take Date as an argument, with your syntax it's just the number of days starting from 1899-12-31, where 2019 gives year 1905 and 4 gives 1 (January 1900)


    You can use either

    DateofServiceYearMonth = RequestSummary[DateofServiceYear]*100 + RequestSummary[DateofServiceMonth]

    or

    DateofServiceYearMonth = YEAR(RequestSummary[DateofService])*100 + MONTH(RequestSummary[DateofService])

     Personally I would use the first one