Forum Discussion
Anonymous
4 years agoNot applicable
Ranking
Hi all, I'm trying to rank each customer's purchases chronologically based on their purchase date starting with "1" for each customer's first purchase and then sequencing numercially with each ad...
- 4 years ago
Hi,
Please check the below picture and the attached pbix file.
Rank invoicenumber base measure: = RANKX ( FILTER ( ALL ( ep_Sales_Invoice_Line ), ep_Sales_Invoice_Line[Customer_Account_Number] = MAX ( ep_Sales_Invoice_Line[Customer_Account_Number] ) ), CALCULATE ( MAX ( ep_Sales_Invoice_Line[INVOICENUMBER] ) ), , ASC )Rank invoicedate base measure: = RANKX ( FILTER ( ALL ( ep_Sales_Invoice_Line ), ep_Sales_Invoice_Line[Customer_Account_Number] = MAX ( ep_Sales_Invoice_Line[Customer_Account_Number] ) ), CALCULATE ( MAX ( ep_Sales_Invoice_Line[Invoice_Date] ) ), , ASC )Rank measure: = RANKX ( FILTER ( ALL ( ep_Sales_Invoice_Line ), ep_Sales_Invoice_Line[Customer_Account_Number] = MAX ( ep_Sales_Invoice_Line[Customer_Account_Number] ) ), [Rank invoicedate base measure:] + [Rank invoicenumber base measure:] / 100, , ASC )
Jihwan_Kim
4 years agoSuper User
Hi,
Please check the below picture and the attached pbix file.
Rank invoicenumber base measure: =
RANKX (
FILTER (
ALL ( ep_Sales_Invoice_Line ),
ep_Sales_Invoice_Line[Customer_Account_Number]
= MAX ( ep_Sales_Invoice_Line[Customer_Account_Number] )
),
CALCULATE ( MAX ( ep_Sales_Invoice_Line[INVOICENUMBER] ) ),
,
ASC
)
Rank invoicedate base measure: =
RANKX (
FILTER (
ALL ( ep_Sales_Invoice_Line ),
ep_Sales_Invoice_Line[Customer_Account_Number]
= MAX ( ep_Sales_Invoice_Line[Customer_Account_Number] )
),
CALCULATE ( MAX ( ep_Sales_Invoice_Line[Invoice_Date] ) ),
,
ASC
)
Rank measure: =
RANKX (
FILTER (
ALL ( ep_Sales_Invoice_Line ),
ep_Sales_Invoice_Line[Customer_Account_Number]
= MAX ( ep_Sales_Invoice_Line[Customer_Account_Number] )
),
[Rank invoicedate base measure:] + [Rank invoicenumber base measure:] / 100,
,
ASC
)
- Anonymous4 years agoNot applicable
Thank you so much, this fixed our problem 🙂