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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to auto increment the values if other column is not null?

 

I have 1 column as open date, i need  to add a new column/measure in power BI to have the incremented values as shown below

 

Open DateNew Column
7/24/13 5:23 PM1
7/24/13 5:23 PM2
7/24/13 5:23 PM3
7/24/13 5:23 PM4
7/24/13 5:23 PM5
9/26/13 6:00 PM6
9/26/13 6:00 PM7
null/blank 
null/blank 
null/blank 
9/26/13 6:00 PM8
9/26/13 6:00 PM9
9/26/13 6:00 PM10
9/26/13 6:00 PM11
9/26/13 6:00 PM12
11/1/13 9:00 PM13
11/1/13 9:00 PM14
6/11/14 10:00 AM15
6/11/14 10:00 AM16
6/11/14 10:00 AM17
6/11/14 10:00 AM18
6/11/14 10:00 AM19
1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on my research, you may click 'Edit Query', go to Query Editor, go to 'Add Column' ribbon, click 'Index Column', make 'from 1 ' selected, close and apply changes.

a1.png

 

Then you may create a calculated column as follows.

 

Skip Null Index = 
IF(
    ISBLANK([Open Date]),
    BLANK(),
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(
            'Table',
            'Table'[Index]<=EARLIER([Index]) 
            && NOT(ISBLANK([Open Date]))
        )
    ) 
)

 

 

Result:

a3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on my research, you may click 'Edit Query', go to Query Editor, go to 'Add Column' ribbon, click 'Index Column', make 'from 1 ' selected, close and apply changes.

a1.png

 

Then you may create a calculated column as follows.

 

Skip Null Index = 
IF(
    ISBLANK([Open Date]),
    BLANK(),
    CALCULATE(
        COUNTROWS('Table'),
        FILTER(
            'Table',
            'Table'[Index]<=EARLIER([Index]) 
            && NOT(ISBLANK([Open Date]))
        )
    ) 
)

 

 

Result:

a3.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank You @v-alq-msft . It worked.

 

Regards,

Shalini

amitchandak
Super User
Super User

Go to edit the query and add the index column. After that create rank and use the index column to break ties.

 

https://community.powerbi.com/t5/Desktop/Rank-distinct-values-for-ties/td-p/194301

 

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors