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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
SonyT01
Regular Visitor

Last 12 Months of Sales into Bins

Hi,

 

I would like to be able to allocate our last 12 months of sales into the below bins.  I have managed to do this by customer count but due to my lack of knowledge of DAX, I can't seem to work out how to do this with the sales amount. 

 

The customer count measure that works perfectly is this:

 

Count of Customers by Sales Bin = SUMX (Bins, COUNTROWS(FILTER(SUMMARIZE(Customers, Customers[Customer Name Grp1]), SalesSplitPrep[Total Sales Last 12 Months] >= Bins[Min Value] && SalesSplitPrep[Total Sales Last 12 Months] < Bins[Max Value])))

 

But how do I do this with Sales ie allocate the 'sum of the last 12 month sales by customer' into the below bins?  It's important that the last 12 mths of sales are grouped by Customer Name Grp1 and Sale_type before determining the sale size/bin.

 

The 'Bins' table looks like this.

 

SonyT01_0-1648689663043.png

 

The 'SalesSplitPrep' table looks like this:

 

SonyT01_1-1648690179110.png

 

My end goal is to create a matrix that is similar to this, showing sales $$.

 

SonyT01_3-1648691193127.png

 

 

Hope someone can help. 🙂

 

 

 

5 REPLIES 5
V-lianl-msft
Community Support
Community Support

Hi @SonyT01 ,

 

According to your description, if you need to group by customer name and display it in the matrix, the customer name field is essential in the matrix. Please share a sample pbix with virtual data.


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Share the link from where i can download your PBI file.


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

Hi Ashish,

 

Thank you for your help but as it is senstive information I would rather not share the file.

 

Thanks.

amitchandak
Super User
Super User

@SonyT01 , refer my blog and Video for the same

 

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Hi Amit,

 

Thank you for your links.  I tried applying one of your measures by switching the AVERAGEX with a SUMX but it's not recognising my 'Bins' table.  Can you see where I might have gone wrong in my measure below?  The column 'Customers'[Customer Name Grp1] is a text field so does that have something to do with it? 

 
SonyT01_0-1648767327354.png

 

 

Thank you.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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