Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

SUM MTD Not working through DateTable

Hi,

LeadCount MTD = 
CALCULATE(SUM(fLeads[LeadCount]), DATESMTD(dDate[Date])) is not working
But if I do directly LeadCount MTD = 
CALCULATE(SUM(fLeads[LeadCount]), DATESMTD(fLeads[DATE_KEY_LEAD])) it works fine.
 
Same thing if I try using:
TOTALMTD(SUM(fLeads[LeadCount]), dDate[Date]) is not working.
TOTALMTD(SUM(fLeads[LeadCount]), fLeads[DATE_KEY_LEAD]) is working fine.

Another measure works fine if I use my Datetable.
Yesterday =CALCULATE( SUM(fLeads[LeadCount]), dDate[Date] = TODAY()-1)
 
I am going mental over here - What am I doing wrong? 

The relationsship must be setup correctly if one measure is working fine. 

Looking forward to your help.
 

 

11 Replies

  • Anonymous , Is the date table connected to your date table.

    Date table marked as a date table .

    You have all dates in date table.

     

    The last one but most important. If you do not select a date on-page. The last date for MTD is the last date of the calendar.  Seem like this the case as you are getting data for the table date because it end in this month

     

    refer : https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

    What is error message or what wrong result you get with the dax that is not working.

     

    Regards
    Paul

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous 

       

      Thank you so much for replying.

      My result is (blank) 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous ,

     

    seems like type mismatch with data tabel and fLeads[DATE_KEY_LEAD], 

     

    make sure fLeads[DATE_KEY_LEAD] is type of date.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 

       

      Seems like it is, right?

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous ,

         

        Seems like not 🙂