Forum Discussion
Generate consecutive calculated column from scratch
- Anonymous4 years ago
Try this code to build a calculated column. You can use Earilier function to catch current row.
CONSECUTIVE = RANKX(FILTER('Table','Table'[ID_CLIENTE] = EARLIER('Table'[ID_CLIENTE])),'Table'[FECHA_VENTA],,ASC,Dense)-1Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickl
Syndicate_Admin add new measure using following:
Rank1 =
RANKX (
FILTER(
ALLSELECTED ( 'Rank' ),
'Rank'[ID_CLIENTE] = MAX ( 'Rank'[ID_CLIENTE] )
),
CALCULATE (
MIN ( 'Rank'[FECHA_VENTA] )
), ,
ASC
) - 1
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- Syndicate_Admin4 years agoAdministrator
Thank you very much for your prompt response!
Could you help me but as a calculated column? Thank you very much in advance.
- Anonymous4 years agoNot applicable
Try this code to build a calculated column. You can use Earilier function to catch current row.
CONSECUTIVE = RANKX(FILTER('Table','Table'[ID_CLIENTE] = EARLIER('Table'[ID_CLIENTE])),'Table'[FECHA_VENTA],,ASC,Dense)-1Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickl
- Syndicate_Admin1 year agoAdministrator
Thank you very much for example! It helped me to solve this challenge... greetings from Guatemala. 🤓