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.
Hello, currently I need to get the number of unique customer sales per agent and I'm using the distinct count of customer name column considering all the filters (see below)
Product ID | Type of Transaction | Employee Name | POS Campaign | Has Relocation Payments To This Order | Date Only | Customer Name |
52988 | sale | Agent A | 0 | 12/15/2022 | Customer A | |
1913547 | sale | Agent A | 0 | 12/15/2022 | Customer B | |
2699468 | sale | Agent A | 0 | 12/14/2022 | Customer C | |
23566 | sale | Agent A | 0 | 12/14/2022 | Customer B | |
51570 | sale | Agent A | 0 | 12/14/2022 | Customer B |
If I filter 12/14 and 12/15 for dates, the number of Unique Customer Sales should be 4 instead of 3 (Customer B appears twice on 12/14 so here it should be 1, and appears one more time on 12/15 so for this particular customer should be 2 sales between that date range). Of course, I still need to consider the filters showing above.
Thank you in advance.
Solved! Go to Solution.
Hi @Gutierrez ,
Please try:
Measure =
SUMX(
SUMMARIZE(
SalesDim,
SalesDim[Customer Name],
SalesDim[Date Only],
"distcount",
CALCULATE (
DISTINCTCOUNT(SalesDim[Customer Name]),
SalesDim[Type of Transaction] = "sale"
&& SalesDim[Has Relocation Payments To This Order] = 0
&& SalesDim[POS Campaign] = BLANK ()
&& SalesDim[Product ID] <> 44405
&& SalesDim[Product ID] <> 44406
&& SalesDim[Product ID] <> 44404
)
),
[distcount]
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @Gutierrez ,
Please try:
Measure =
SUMX(
SUMMARIZE(
SalesDim,
SalesDim[Customer Name],
SalesDim[Date Only],
"distcount",
CALCULATE (
DISTINCTCOUNT(SalesDim[Customer Name]),
SalesDim[Type of Transaction] = "sale"
&& SalesDim[Has Relocation Payments To This Order] = 0
&& SalesDim[POS Campaign] = BLANK ()
&& SalesDim[Product ID] <> 44405
&& SalesDim[Product ID] <> 44406
&& SalesDim[Product ID] <> 44404
)
),
[distcount]
)
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
104 | |
77 | |
67 | |
63 |
User | Count |
---|---|
144 | |
107 | |
105 | |
82 | |
69 |