cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vacuumkite Regular Visitor
Regular Visitor

Customer Frequency Bins - DAX

Hi all, 

 

I am trying to visualize frequency bins of customers visits (eg - number of customers who visited between 2-5 times, 6-10 times, 10+ times etc) in a given period (based on date slicer). I have a Table1 with customer_Id, date(eg - 11/12/2018) and order_id. So customer_id is repeated in rows based on number of times a customer visited.  Now I  used calcualted table to get the results.

 

Cust-Freq-Table = summarize('Table1','Table1'[Customer_Id],
"Customer-Freq",COUNT('Table1'[Customer_Id]))

 

But the problem is it is not filtering by date slicer. What can I do ? Please suggest. 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite solution attached, you can tweak it as per your needs.





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite and also make sure the sort order on visual is by bin, you can check that by clicking three dots on top right corner of the visual.





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




14 REPLIES 14
Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite hey if you share some sample data in excel using onedrive/google drive and can get you the solution. 





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




vacuumkite Regular Visitor
Regular Visitor

Re: Customer Frequency Bins - DAX

@parry2k   Here is the link to the excel file https://drive.google.com/open?id=1TvR_S4du3o7eYxGxfe9_qM55uQjr73K2  

I have only "raw" sheet  with me. I need to get to the graph in "bin" sheet when the date slicer is 11/12/2018 to 12/11/2018 (when I change the dates I expect graph to change but that is not happening prperly with my current dax).  Also I want bin sizes in order in the x-axis like [1-2] then [3-5] and then [6-10]. 

I hope that helps. 

Thanks!

Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite link is not reachable, can you reshare it?





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




vacuumkite Regular Visitor
Regular Visitor

Re: Customer Frequency Bins - DAX

@parry2k  My apologies...

https://drive.google.com/drive/folders/146Da7nfCDA2hIhFiYDOmZT3OaLKnEezA?usp=sharing

Also, do not want to count all the rows with blank CustomerID.  

Thanks!

 

 

Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite solution attached, you can tweak it as per your needs.





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




vacuumkite Regular Visitor
Regular Visitor

Re: Customer Frequency Bins - DAX

Thanks!

vacuumkite Regular Visitor
Regular Visitor

Re: Customer Frequency Bins - DAX

@parry2k  This works perfectly. One minor problem though. I am not getting x-axis by the bin sizes. I am using  the exact code you sent me. Seems it is always rearranging based on y axis values. 

Capture.PNG

 

Thanks!

Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite i have id column in bin table, you need to sort bin column by id column so that it shows labels correctly.





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.




 




Super User
Super User

Re: Customer Frequency Bins - DAX

@vacuumkite and also make sure the sort order on visual is by bin, you can check that by clicking three dots on top right corner of the visual.





Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Kudos Help Smiley Happy
Connect with me on Linkedin. Feel free to email me with any of your BI needs.