Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KoalaPBI
Frequent Visitor

Measure to calculate 'for clients signed up 3 months ago, how many made payment in next two months'

Hi community,

In the following dataset,  I want to create a measure to calculate :  'for clients signed up 3 months ago, how many made payment in next two months'. Then calculate the monthly average over these next two months.

for instance, in following snippet if 22 clients signed up 3 months ago( in Apr), out of 22, 11 made a payment in May & 15 made a payment in June, then monthly average over May & June:  (11+15)/(22x2)=59%

 

KoalaPBI_1-1658797417753.png

 

Here is my sample pbi file:

https://1drv.ms/u/s!Ag919_pO_UKrghhIKgRk6OM2HdLS?e=HB1m2N

 

Many thanks for your help!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please try using the below measure.

 

client count within two months ratio: =
VAR _twomonthlaterendofmonth =
    EOMONTH ( MAX ( Datedim[Date] ), 2 )
VAR _customerlist =
    FILTER (
        SUMMARIZE ( 'Table', 'Table'[Client_id], 'Table'[paid_date] ),
        'Table'[paid_date] <= _twomonthlaterendofmonth
    )
RETURN
    DIVIDE ( COUNTROWS ( _customerlist ), [Signups] * 2 )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

Please try using the below measure.

 

client count within two months ratio: =
VAR _twomonthlaterendofmonth =
    EOMONTH ( MAX ( Datedim[Date] ), 2 )
VAR _customerlist =
    FILTER (
        SUMMARIZE ( 'Table', 'Table'[Client_id], 'Table'[paid_date] ),
        'Table'[paid_date] <= _twomonthlaterendofmonth
    )
RETURN
    DIVIDE ( COUNTROWS ( _customerlist ), [Signups] * 2 )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.