Forum Discussion

TOYER01's avatar
TOYER01
Helper I
3 years ago
Solved

SALES CALCULATION MTD

I have a source file having a column called "Sales" from January 2023 to December 2023. 

 

I want to display on the card, total sales for June, and when its july, it should switch to july total sales and so on

 

 

 

 

 

5 Replies

  • pls try this

    Sales = SUM(technics[Value])
     

  • TOYER01 , Try like

     

    MTD =
    var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
    var _min = eomonth(_max,-1)+1 ,
    return
    CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

     

    or

     

     

    MTD Today =
    var _min = eomonth(today(),-1)+1
    var _max = today()
    return
    CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))