Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I am trying to find customers who bought more than $500 worth of stuff.
SumX for More than $500 with summarize =
SUMX (
'CPP POS',
CALCULATE (
SUM ( 'CPP POS'[Sales Amount] ),
FILTER (
SUMMARIZE ( 'CPP POS', RETAILER[Parent Retailer AB Number] ),
SUM ( 'CPP POS'[Sales Amount] ) > 500
)
)
)
It works for individual row but gives me same result of total as if $500 filter is not applied. Below:
Any help is appreciated. Thanks.
Ritesh
@Ritesh_Air , Try like
sales = sumx(filter(SUMMARIZE ( RETAILER, RETAILER[Parent Retailer AB Number] ,"_1" ,SUM ( 'CPP POS'[Sales Amount] ) ),[_1]>500),[_1])
Retailer count = countx(filter(SUMMARIZE ( RETAILER, RETAILER[Parent Retailer AB Number] ,"_1" ,SUM ( 'CPP POS'[Sales Amount] ) ),[_1]>500),[Parent Retailer AB Number])
unfortunately no. Both of your formulas still gives me 1.04M. Adding a new picutre to give more context.
The problem is: the number you are seeing on the screen : for e.g.: $2196 could be made up of 2 transaction lines $1900 and $296, and as shown above in one of the formulas, I do want to include everything at the grower level.
I tried to change my formula in summarize to Grower instead of Retailer as well but still getting the same answer.
Break your formula into two and see the results
SumX for More than $500 with summarize =
CALCULATE (
SUM ( 'CPP POS'[Sales Amount] ),
FILTER (
SUMMARIZE ( 'CPP POS', RETAILER[Parent Retailer AB Number] ),
SUM ( 'CPP POS'[Sales Amount] ) > 500
)
)
_SUMXformorethan500 =
SUMX (
'CPP POS',[SumX for More than $500 with summarize])
Proud to be a Super User!
Thanks. I tried that too but the problem is: if I have 2 line items for the same retailer
which constitutes $2196 (which is sum of $1879 + 317), it filters $317 row, which I want to include.
Hence I thought if I summarize it at the Retailer level then it will give me answer at that granularity.
So in below example, overall total should be little higher than $749K but less than $1.04M.
Thanks,
Ritesh
Hi @Ritesh_Air
"if I have 2 line items for the same retailer
which constitutes $2196 (which is sum of $1879 + 317), it filters $317 row, which I want to include."
Not quite understand, where does the $317 row? Do you like to include it or exclude it? could you plz provide the detailed data rather than fragment? that will be helpful for us to investigate it further.
You can upload the dummy pbix to the onedrive for business and share the link here. please don't forget to disclose the expected results and remove the confidential info.
Try Change forumla a bit
SumX for More than $500 with summarize =
CALCULATE (
SUMX(Values( RETAILER[Parent Retailer AB Number] ), SUM ( 'CPP POS'[Sales Amount] )
)
)
_SUM = CALCULATE( SUMX('CPP POS',[SumX for More than $500 with summarize]) , FILTER( 'CPP POS',[SumX for More than $500 with summarize]>500))
Proud to be a Super User!
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |