Forum Discussion
SJ25
Resolver I
6 years agoGenerating number sequence based on condition
Hello All, I have a table with 2 columns Order number and Steps, and I am want to add a third column that will give me a sequence number based on the order number. An Example of what I want is sh...
- 6 years ago
amitchandak This link: https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query gave me exactly what I was looking for.
sanimesa
Post Prodigy
6 years agoSJ25You can do this in DAX.
Please define the below column and two measures in this sequence:
Steps num = 26 - FIND(RankFromSequence[Steps], "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
Total Steps Num = SUM(RankFromSequence[Steps num])
Sequence Number Measure = RANKX(ALLEXCEPT(RankFromSequence, RankFromSequence[Order Number]), [Total Steps Num])
Then use the Sequence Number Measure in your visual.