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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
shekhar_shres
Advocate II
Advocate II

Grouped customer(no of unique) by count of orders. But cannot group the count of orders into range

Hi all I have a sales order table

 

OrderID CustomerID ProductID Date etc

I have been asked to group the number of customer by count of their orders and I am able to do so. Following is the example of what I did.

First I created a segment table with one column

Pic 1

shekhar_shres_0-1626736710465.png

Total SalesOrder(In Pic 1) = countrows(SalesOrder)

The table 'LinkSalesOrder' is created as follows;
Pic 2

shekhar_shres_6-1626738236048.png

 

I referred the only column of the above table No of orders as Selected Segment( Selected Segment = Selected Value(LinkSalesOrder[No of orders]) This measure is branched in following dax in image(Pic 3)

The above table will give me a table with column from 1 to the X number of rows (where x is a maximum number of order a certain customer has made). So, the segment table ranges from 1 to 1680. Thats quite a large range. I did following to ascertain number of customer with x number of orders

Pic 3-

shekhar_shres_2-1626737082173.png

Once I did this I got following in my visualization as table. 

Table - 1

shekhar_shres_12-1626738751208.png


Now the problem is I cannot group the number of placement into range like 1-5 orders, 6-10 orders. I applied the range logic in the LinkSalesOrder table and created a new column with ranges. Following is the image of table LinkSalesOrder

Pic 4

shekhar_shres_5-1626738166408.png

 

However, whenever I put a Range in a table visualization and add the measure [Count of Customer with x no of ordersss] (pic 3), I get blank. For example, for range 1-5 orders, it is not aggregating the total customer who placed 1,2,3,4,5 count of orders.


I need to be able to get those [count of customer with x no of ordersss] using Dax, because there are a lot of granularity in the data that users do want to slice by. Also the data is ranged from 2010, so group by in Power Query would not be any helpful. Is there any other way I can Assign range to it. 


Referring to Table 1. Following is the result I want.
Table - 2

Order RangesNo of Customer who ordered between X Range
1-5 orders1200
100-500 orders90
More than 500 orders20


But following is the result I am getting

Pic-5

shekhar_shres_9-1626738520129.png


It works as follows when No of order column is there. But as soon as I take number of orders out. It gives me result as in Pic-5

shekhar_shres_10-1626738613895.png

I have tried multiple workarounds but so far I am unsuccessful. Is there anyway I can apply range to the number of orders and group the count of those customer in a relevant range?

Your response will be highly appreciated

 

 

 

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi  @shekhar_shres ,

 

You need to create a dimension table such as below:

Range
1 to 5 Placement
5-10 Placement
10-20 Placement

Then create a measure to link the dimension with your measures.

If you are still frustrated,pls provide some dummy data with expected output for test.

 

Best Regards,
Kelly

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors