Forum Discussion
Sales per customer with classification/area assignment (total/%, cluster groups, and running total)
- 5 years ago
Hi, tbones
According to your description and sample pictures, I can roughly understand what you want to get, you can try my steps:
- Create a measure like this:
% of customers with at least one qualified sales = DIVIDE(CALCULATE(DISTINCTCOUNT('Sales'[Account]),FILTER(ALLSELECTED(Sales),[Qualified_Sale]=1)),DISTINCTCOUNT('Sales'[Account]))- Then create a silcer and place [Owner] and a card chart to place this measure, this can achieve your first requirement:
- Then create a calculated column like this:
Sales count = var _count=COUNTX(FILTER(ALLSELECTED(Sales),[Account]=EARLIER(Sales[Account])&&[Qualified_Sale]=1),[ID]) return SWITCH( TRUE(), _count>=4,"4+ sales", _count>=3,"3+ sales", _count>=2,"2+ sales", _count>=1,"1+ sales", "0 sales")And two measures like this:
Running total = COUNTX(FILTER(ALLSELECTED(Sales),[Date]<=MAX('Sales'[Date])),[ID])% of all customers = var _count=COUNTX(FILTER(ALLSELECTED(Sales),[Account]=MAX(Sales[Account])&&[Qualified_Sale]=1),[ID]) return DIVIDE(_count,[Running total])- Then create two line chart like this, this can achieve your second requirement:
And you can get what you want.
You can download my test pbix file here
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, tbones
According to your description and sample pictures, I can roughly understand what you want to get, you can try my steps:
- Create a measure like this:
% of customers with at least one qualified sales =
DIVIDE(CALCULATE(DISTINCTCOUNT('Sales'[Account]),FILTER(ALLSELECTED(Sales),[Qualified_Sale]=1)),DISTINCTCOUNT('Sales'[Account]))
- Then create a silcer and place [Owner] and a card chart to place this measure, this can achieve your first requirement:
- Then create a calculated column like this:
Sales count =
var _count=COUNTX(FILTER(ALLSELECTED(Sales),[Account]=EARLIER(Sales[Account])&&[Qualified_Sale]=1),[ID])
return
SWITCH(
TRUE(),
_count>=4,"4+ sales",
_count>=3,"3+ sales",
_count>=2,"2+ sales",
_count>=1,"1+ sales",
"0 sales")
And two measures like this:
Running total = COUNTX(FILTER(ALLSELECTED(Sales),[Date]<=MAX('Sales'[Date])),[ID])% of all customers =
var _count=COUNTX(FILTER(ALLSELECTED(Sales),[Account]=MAX(Sales[Account])&&[Qualified_Sale]=1),[ID])
return
DIVIDE(_count,[Running total])
- Then create two line chart like this, this can achieve your second requirement:
And you can get what you want.
You can download my test pbix file here
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.