Forum Discussion

Ajeck's avatar
Ajeck
Helper III
5 years ago
Solved

comparation today

Deaer All,

 

Can Any body help me?

 

How I can get the total sales of a month (from 1 st day to end of month)

how can i get end of month date (31 Jan, 28 Feb, 31 March, 30 Apr , etc....)

 

Thankyou for helping me

 

Rgds

Aji

  • Ajeck 

    Please check if this is what you want.

    Measure 2 = 
    var MAXDATE=MAX('sales'[tanggal])
    RETURN CALCULATE(SUM(sales[sales]),FILTER(sales,MONTH(sales[tanggal])=MONTH(MAXDATE)-1&&YEAR(sales[tanggal])=YEAR(MAXDATE)))
    
    Measure 3 = 
    var MAXDATE=MAX('sales'[tanggal])
    RETURN CALCULATE(SUM(sales[sales]),FILTER(ALL(sales),MONTH(sales[tanggal])=MONTH(MAXDATE)&&YEAR(sales[tanggal])=YEAR(MAXDATE)-1))

     

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Ajeck Would need sample source data as text and expected output to be 100% but, you can get the end of any month like this:

    End of Month = EOMONTH([Date],0)
    • Ajeck's avatar
      Ajeck
      Helper III

      Thank you for helping me, I used this : End of Month = EOMONTH('Invoked Function'[Date],0) then I make a card visualitation, but it dint't work.

       

      What should I do?

       

      Rgds

      AJeck

       

      • ryan_mayu's avatar
        ryan_mayu
        Super User

        Ajeck 

        you need to create a column for this. or try

        EOMONTH(today(),0)

        it's better to provide sample data and expected output to get proper solution.