Forum Discussion

KoalaPBI's avatar
KoalaPBI
Frequent Visitor
4 years ago
Solved

Measure help to count clients

Hi there,

Following is my sample dataset:

 

I want to create a measure to know 'amongst people who are still in their first 3 months from signup date (that is people who signed up from 22/04/2022 onwards), count of people who made a payment since then, split across relevant months'.

For example : client_id 2 falls in this measure & made a payment in Apr, May, Jun & Jul and is counted in months from Aprl to Jul.

So, the measure result for the above dataset is like this:

 

 

Here is my sample pbi file: https://1drv.ms/u/s!Ag919_pO_UKrghcn8byYZRmTO2TS?e=INaTZr

 

Many thanks for your help!

 

 

 

 

 

 

 

 

 

 

 

  • KoalaPBI ,

    Seem like you need running total

     

    Measure = CALCULATE(distinctCount('Table'[Client_id]) ,filter(allselected(Datedim), Datedim[Date] <= max(Datedim[Date]) && Datedim[Date] >= EOMONTH(TODAY(),-4)+1 && Datedim[Date] <= TODAY()))

3 Replies

  • KoalaPBI , Create a measure like

     

    Measure =

    var _max = Today() ,

    var _min = date(year(_max), Month(_max) -3, day(_max) )

    return

    calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

     

     

    or

     

    Measure =

    var _max = Today() ,

    var _min =eomonth(_max,-4)+1

    return

    calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

      • amitchandak's avatar
        amitchandak
        Super User

        KoalaPBI ,

        Seem like you need running total

         

        Measure = CALCULATE(distinctCount('Table'[Client_id]) ,filter(allselected(Datedim), Datedim[Date] <= max(Datedim[Date]) && Datedim[Date] >= EOMONTH(TODAY(),-4)+1 && Datedim[Date] <= TODAY()))