Forum Discussion
Countby price range
Hello,
Can anyone help me out to count the number of purchases by price/amount range?
I currently have a measure as follows:
Range CountOf Purchases
$1 - $50 50
$51- $100 101
$101 - $250 78
$251 - $500 60
$501 - $1000 12
$1000 + 2
Thank you iin advance for your support.
This approach uses a disconnected table named Segmentation:
Create measure:
Purchase Count Segmented = SUMX ( Segmentation, COUNTROWS ( FILTER ( Transactions, Transactions[Amount] > Segmentation[Range Min] && Transactions[Amount] <= Segmentation[Range Max] ) ) )Result:
You can specify the additional filters on Platform, TransactionType, and PaymentBy either in filters or adding them to the FILTER function. Specifying these as filters would enable the measure to be generic and thus reflect any user-specified filters.
2 Replies
- DataInsightsSuper User
This approach uses a disconnected table named Segmentation:
Create measure:
Purchase Count Segmented = SUMX ( Segmentation, COUNTROWS ( FILTER ( Transactions, Transactions[Amount] > Segmentation[Range Min] && Transactions[Amount] <= Segmentation[Range Max] ) ) )Result:
You can specify the additional filters on Platform, TransactionType, and PaymentBy either in filters or adding them to the FILTER function. Specifying these as filters would enable the measure to be generic and thus reflect any user-specified filters.
- Mente73Frequent Visitor
Thank you for your time and solution, worked as expected.