Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

BIN Range / Dynamic Segmentation based on measure

I have StoreId's and their sales(column name = RetailDollars). I have created a measure for totalsales - 

Totalsales$ = SUM(SellThrough[RetailDollars]) 
I have created a BIN
 

bin.PNG

 

 

 

 

Then created a measure to count the number of stores

Sheet1(2) is Bin table name and sell through is sales tables name.
stores.PNG

Results is showing something like this

resultq.PNG

 

 

 

 

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.

1 ACCEPTED SOLUTION

@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]))

Capture.PNG 

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.

 

View solution in original post

6 REPLIES 6
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Could you please share the two tables sample data and give the expected result?

 

Regards,

Jimmy Tao

Anonymous
Not applicable

Hi Jimmy,

 

This is my sample data set

 

sellthru.PNG

 

 

 

 

 

I would like to see how many stores made sales between 0 to 5000, 5000 to 50,000 and >50,000.

 

Expected result

resu2.PNG 

Hi,

There should be only 1 store in the Gold bucket - StoreID 2.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@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]))

Capture.PNG 

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.

 

Anonymous
Not applicable

Hi 

This is really helpful. It made my work easy but I would also like to see the store ID's that made total sales in that particular range (Gold,Platinum,Silver) for selected year. 

 

For example I want to see what all storeIDs made total sales in the gold range for 2019.

TomMartens
Super User
Super User

Hey @Anonymous ,

 

I guess this article: https://www.daxpatterns.com/dynamic-segmentation/

provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors