cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ebeauchamp Frequent Visitor
Frequent Visitor

Count Leavers based on conditions (revenue this period and previous period)

Hi everyone,

 

I am trying to do a distinct count of leaving customers that match two criterias: had a revenue > 0 in the previous period, and is at 0 in this period. Can't get the right syntax so thanks for your help!

For other needs, the time periods work well with the date slicer on the page, and are measured like this:

This Period Revenue = SUM(Transactions[DailyUsage$])

 

Previous Period Revenue = CALCULATE(SUM(Transactions[DailyUsage$])
,DATESBETWEEN(
Dates[Date],
[Start of Previous Period],
[End of Previous Period]),
ALL(Dates) )

 

This measure is also working well:
CountOrganizations = CALCULATE(DISTINCTCOUNT(Transactions[OrganizationUniqueName]))

 

It's when trying to add conditions to this count that I can't get it to work. Example tried from seeing other posts:
CountLeavers = CALCULATE(DISTINCTCOUNT(Transactions[OrganizationUniqueName]),FILTER(ALL(Transactions),[Previous Period Revenue]>0,[This Period Revenue]=0))

Any idea on how to make it work? Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Count Leavers based on conditions (revenue this period and previous period)

Hi, @ebeauchamp 

Due to filters interfering with each other ,it maybe failed to get correct figure.

I think if  other measures work well, you'd better to use these  measures as variables in measure “CountLeavers”, similar to the following:

CountLeavers= 
var  _This_Period_Revenue = SUM(Transactions[DailyUsage$])
var  _Previous_Period_Revenue = CALCULATE(SUM(Transactions[DailyUsage$])
,DATESBETWEEN(
Dates[Date],
[Start of Previous Period],
[End of Previous Period]),
ALL(Dates) )
Return
CALCULATE(DISTINCTCOUNT(Transactions[OrganizationUniqueName]),FILTER(ALL(Transactions),_Previous_Period_Revenue>0,_This_Period_Revenue=0))

If it doesn't meet your requirement, kindly share your sample data and expected result if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1

Re: Count Leavers based on conditions (revenue this period and previous period)

Hi, @ebeauchamp 

Due to filters interfering with each other ,it maybe failed to get correct figure.

I think if  other measures work well, you'd better to use these  measures as variables in measure “CountLeavers”, similar to the following:

CountLeavers= 
var  _This_Period_Revenue = SUM(Transactions[DailyUsage$])
var  _Previous_Period_Revenue = CALCULATE(SUM(Transactions[DailyUsage$])
,DATESBETWEEN(
Dates[Date],
[Start of Previous Period],
[End of Previous Period]),
ALL(Dates) )
Return
CALCULATE(DISTINCTCOUNT(Transactions[OrganizationUniqueName]),FILTER(ALL(Transactions),_Previous_Period_Revenue>0,_This_Period_Revenue=0))

If it doesn't meet your requirement, kindly share your sample data and expected result if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)