Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi all,
I have something which I thought would be a relatively easy solution, but I haven't been able to find any posts or a way to successfully do this after doing a ton of research. Has anyone run into this before?
I have a table with order number, customer number, and transaction date, and I need to count/group the number of orders per customer in sequential order, based on order date. E.g., for a customer number, if they have placed 4 orders, I'd expect to see 1, 2, 3, 4 next to the order number for a particular customer.
Here is an example dataset - hoping to calculate the 'Orders' column:
Thank you so much for looking into this! Any input is greatly appreciated.
Solved! Go to Solution.
Try changing it to
Num order =
RANK (
DENSE,
ALL ( 'Table'[Order number], 'Table'[Customer] ),
ORDERBY ( 'Table'[Order number], ASC ),
PARTITIONBY ( 'Table'[Customer] ),
)
Hi @user5341567
This is my sample data:
You can get the result you want by using the following calculate column:
Column = RANKX(FILTER(ALL('Table'),'Table'[CustomerNumber] = EARLIER('Table'[CustomerNumber])),'Table'[OrderNumber],,ASC,Dense)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You could create a column like
Num order =
RANK (
DENSE,
ALL ( 'Table' ),
ORDERBY ( 'Table'[Order number], ASC ),
PARTITIONBY ( 'Table'[Customer] ),
)
Thank you so much for your response! I got a Circular Dependency error unfortunately - perhaps because I sometimes have several of the same order number?
Try changing it to
Num order =
RANK (
DENSE,
ALL ( 'Table'[Order number], 'Table'[Customer] ),
ORDERBY ( 'Table'[Order number], ASC ),
PARTITIONBY ( 'Table'[Customer] ),
)
That worked perfectly. Thank you for your response!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
48 |
User | Count |
---|---|
215 | |
90 | |
83 | |
67 | |
59 |