Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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
Solved! Go to Solution.
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.
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.
User | Count |
---|---|
127 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |