Forum Discussion

LangeJan's avatar
LangeJan
Icon for Helper I rankHelper I
3 years ago
Solved

Total count in a period

Hi I would like to count the total number of customers, so I can show that i 2019 we had 6 customers and in 2020 we had 7 customers and so on. Which function is the right one to choose for that? ...
  • MFelix's avatar
    3 years ago

    Hi LangeJan ,

     

    Create the following two measures:

     

    Cumulative customers = CALCULATE(DISTINCTCOUNT('Table'[CustNumber]), 'Table'[year]<= MAX('Table'[year]))
    
    var cumulative =
    [Cumulative customers]
        - CALCULATE ( [Cumulative customers], 'Table'[year] = MAX ( 'Table'[year] ) - 1 )