Forum Discussion

Wiene24's avatar
Wiene24
Helper II
7 years ago

EOMONTH and SAMEPERIODLASTYEAR

Hi,

 

I am currently calculating the total up to last month by using the following formula:

 

Omzet tm vorig maand = CALCULATE(TOTALYTD([Totaal omzet];FILTER(ALLSELECTED('Datumtabel laadmeter'[Date]);'Datumtabel laadmeter'[Date] <= EOMONTH(TODAY();-1))))
 
If I want the same number, so basicly all revenue from 1-1-2018 untill 31-7-2018 I used 
Omzet tm vorige maand vorig jaar = CALCULATE([Omzet tm vorig maand];SAMEPERIODLASTYEAR('Datumtabel laadmeter'[Date])
 
But that is giving me the value untill 31-12-2018, but i don't understand why.
 
Hopefully someone can help.
 
Kind regards,
 
Tim Wijnen
 

3 Replies

    • Wiene24's avatar
      Wiene24
      Helper II

      Hi Anonymous,

       

      The problem is that I can't work with MAX, because we have orders in the future.

      With the year it could work because my date table is only untill the end of 2019.

      But for the month MAX is maybe october or november, so that will return a different value.

      Is there a way I can use EOMONTH in the TITHW?

       

      Kind regards,

       

      Tim Wijnen 

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI Wiene24 ,

        Can you please share some sample data and expected result for test?

        Regards,

        Xiaoxin Sheng