Forum Discussion

fksng66's avatar
fksng66
Helper II
1 year ago
Solved

Date format issue

Hi there, I'am trying to get the last date value of each month, for example I should only be getting sum of all values on 31st May 2025, but the final value output doesn't seem to match with the expe...
  • v-hashadapu's avatar
    v-hashadapu
    1 year ago

    Hi fksng66 , Thank you for reaching out to the Microsoft Community Forum.

     

    Unfortunately, what you're trying to do isn't possible with DAX or measures alone while the date column has inconsistent formats like mm/dd/yyyy and dd/mm/yyyy. Power BI cannot reliably detect the correct last date of the month if it's misinterpreting some dates (like 05/12/2025 being seen as December 5 instead of May 12).

     

    The only way to make your original formula work is to ensure the column is a proper Date type with a consistent format during the data load stage ideally in Power Query using the Change Type Using Locale option. Otherwise, any logic based on date comparisons will return incorrect results.

     

    I know it's not the answer you'd hoped for but just wanted to clarify that this limitation isn't something DAX or visuals can fix it has to be resolved at the source or Power Query level.

     

    Custom Date Formats in Power BI Using a Slicer - Microsoft Fabric Community