Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I have a current requirement to calculate the distinct number of customers who are buying producting within a given time period. This time period could be 1 day, 10 days, monthly, quarterly, etc. The table is at the invoice line level. The requirement is that within the given time period selected, to be counted, the customer had to have done business in which the sum of the sales amount is not zero.
The current calculation is as follows:
CustomerCount:=CALCULATE(DISTINCTCOUNT(Transactions[CustomerCount]),
FILTER(Transactions,[NetSales]<>0 )
)
The filter measure is:
NetSales:=SUMX(filter(Transactions,Transactions[system_currency_adj_3rd_party_line_total_amt]<>0&&Transactions[is_revenue_ind]=1&&Transactions[Transaction_Type_Aggregate]="Net Sales"),Transactions[system_currency_adj_3rd_party_line_total_amt])
I still end up with a handful of customers that are counted because their line items are both positive (invoice) and negative (credit) but should not because their total NetSales for the given period is 0.
I tried the following:
CustomerCounttest:=
CALCULATE(
DISTINCTCOUNT( Transactions[ParentPartnerID]),
FILTER (
ALLEXCEPT(Transactions,
CALCULATE(sum(Transactions[NetInvoiceAmt]))<>0
)
)
but I end up with a memory exceeds the visualization error
This cannot be that hard of a scenario to solve for. Please note this is currently deployed in Azure Analysis Services.
Any help is appreciated!
Joe
Solved! Go to Solution.
@jgb231 , Not very clear, do you want to count customer net sales <> 0 where net sales is a measure. Ideally if there no negative amount, you are getting that only.
Otherwise you need to have a measure like
Example measure
countx(filter(Values(customer[Customer id]),[Net sales]<>0 ), [Customer id])
Try a measure like above
if not
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@jgb231 , Not very clear, do you want to count customer net sales <> 0 where net sales is a measure. Ideally if there no negative amount, you are getting that only.
Otherwise you need to have a measure like
Example measure
countx(filter(Values(customer[Customer id]),[Net sales]<>0 ), [Customer id])
Try a measure like above
if not
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
The countx did it! Thank you so much!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
13 | |
11 | |
9 | |
8 | |
8 |