Forum Discussion

MikeEcho's avatar
MikeEcho
Frequent Visitor
9 years ago
Solved

Total Sales for same month last year

I have looked everywhere, and the examples I did find don't seem to work. I understand how to do the YTD.MTD's est, but cannot find one of the probably most simple formulas and that is: How do ...
  • v-ljerr-msft's avatar
    v-ljerr-msft
    9 years ago

    Hi MikeEcho,

     

    After reviewing your shared pbix file, I find that most of your dbdate values are DateTime type which has a time value that is not "12:00:00 AM". That's why most of them are not matched with the Dates in Calendar table(with a time value of "12:00:00 AM").

     

    So I use the formula below to add a new calculate column called "dbdate2" to get only the Date part of dbdate column in data2 table, and recreate the relationship with dbdate2 column between these two tables, then all works as expected.

    dbdate2 = DATEVALUE(data2[dbdate])

    Here is the modified pbix file for your reference. :smileyhappy:

     

    Regards