Forum Discussion

beaoliv123-_'s avatar
beaoliv123-_
Helper I
4 years ago

Calculate until date

Hi there, I'd like to know what were my customers from the beggining until last month. How do I do this filtering?

Thanks 

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, 

    Not a lot of detail, but does this help you?

    Value from start to EndOfLastMonth = 
    CALCULATE(
        SUM(SalesTransactions[Amount]) // Sum amount
        ,'Calendar'[Date] <=EOMONTH(MAX('Calendar'[Date]),-1) //Filter for end of month
        )

     

  • isabella's avatar
    isabella
    Microsoft Employee

    I did a local test,you can set filters like this:

     

     

    Then you can create a measure to calculate the distinct count of customer before this month

     

    customerCountBeforeThisMonth = CALCULATEDISTINCTCOUNT('Table'[customer]),FILTER(ALL('Table'),[date]<DATE(2022,6,1)))

     

     

     

     

     

    Best Regards,

    Community Support Team _Isabella

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.