Forum Discussion
BIN Range / Dynamic Segmentation based on measure
I have StoreId's and their sales(column name = RetailDollars). I have created a measure for totalsales -
I have created a BIN
Then created a measure to count the number of stores
Sheet1(2) is Bin table name and sell through is sales tables name.
Results is showing something like this
which is not accurate.
Could someone please help me solve this issue ?
FYI : I have converted storeId's column to text which are actual numbers.
Anonymous ,
You can simply create a calculate column in the sales table using dax as below:
Number of stores = CALCULATE(COUNT('Table'[StoreID]), FILTER('Table', 'Table'[Sales] >= Bin[Min_Value] && 'Table'[Sales] <= Bin[Max_Value]))Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- TomMartensSuper User
Hey Anonymous ,
I guess this article: https://www.daxpatterns.com/dynamic-segmentation/
provides what you are looking for.
Regards,
Tom
- v-yuta-msftCommunity Support
Anonymous ,
Could you please share the two tables sample data and give the expected result?
Regards,
Jimmy Tao
- AnonymousNot applicable
Hi Jimmy,
This is my sample data set
I would like to see how many stores made sales between 0 to 5000, 5000 to 50,000 and >50,000.
Expected result
- v-yuta-msftCommunity Support
Anonymous ,
You can simply create a calculate column in the sales table using dax as below:
Number of stores = CALCULATE(COUNT('Table'[StoreID]), FILTER('Table', 'Table'[Sales] >= Bin[Min_Value] && 'Table'[Sales] <= Bin[Max_Value]))Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.