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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
SJ25
Resolver I
Resolver I

Generating 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 shown in the table below:

 
Order NumberStepsSequence Number
1111A1
1111B2
1111C3
1112B1
1112D2

 

Any suggestions on how I can accomplish this or what the DAX formula should look like?

 

Thanks

1 ACCEPTED SOLUTION

4 REPLIES 4
sanimesa
Post Prodigy
Post Prodigy

@SJ25You 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.

pbi forum - rank within group.PNG

amitchandak
Super User
Super User

@SJ25 , Rank will check column rank

For Rank Refer these links

https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@SJ25 , seem like there are few steps, but fine as long as it solves the problem.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.