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! Request now

Reply
heathernicole
Continued Contributor
Continued Contributor

Auto increment a measure in Power BI

Here's the dataset:

1)Event Date       2)Factory Scheduled Date  3)Auto Scheduled date     4)Combined Column

12/29/20172/16/2018 2/16/2018
12/29/20172/23/2018 2/23/2018
12/29/20172/23/2018 2/23/2018
12/29/20172/23/2018 2/23/2018
12/29/20172/23/2018 2/23/2018
 2/23/2018 2/23/2018
12/29/20173/2/2018 3/2/2018
12/29/20173/2/2018 3/2/2018
12/29/20173/2/2018 3/2/2018
12/29/20173/2/2018 3/2/2018
12/29/2017 3/9/20183/9/2018
12/29/2017 3/9/20183/9/2018
12/29/2017 3/16/20183/16/2018
12/29/2017 3/16/20183/16/2018
12/29/2017 3/23/20183/23/2018
12/29/2017 3/23/20183/23/2018
12/29/2017 3/23/20183/23/2018
12/29/2017 3/30/20183/30/2018
12/29/2017 3/30/20183/30/2018

 

 

Process:

  • The Event Date Column sets the priority
  • The Factory Scheduled date is just that - the date the factory schedules the order to be completed
  • If there is no factory date scheduled the 'Auto-scheduled' date kicks in to help the factory "predict" when it will be done with it's orders.

 

I have this formula:

Scheduling Group Column =
IF (
    ' Data [Running Total COLUMN] = 0,
    BLANK (),
    ( INT ( DIVIDE ( ' Data '[Running Total COLUMN], 33000 ) + 9 ) )
)

That gives each order a Scheduling group number. The '9' in that formula is what I need to "auto-increment' based on the following:

 

It's tied to this 'Week End Scheduler' table (date table)

DateIndex
1/12/20181
1/19/20182
1/26/20183
2/2/20184
2/9/20185
2/16/20186
2/23/20187
3/2/20188
3/9/20189
3/16/201810
3/23/201811
3/30/201812
4/6/201813
4/13/201814
4/20/201815
4/27/201816
5/4/201817
5/11/201818
5/18/201819
5/25/201820
6/1/201821

 

So if the LAST factory scheduled date is 3/2/2018 (as in the sample set) - I need that formula to 'auto-schedule' to the NEXT week's date (3/9/2018). In this case the '9' in the measure posted above forces the increment to the next date available. It's tied to the Id column in the Week End scheduler table. 

 

But I currently manually have to adjust it. I'm trying to figure out how to automatically look at the next dateand then start auto-scheduling for the following week's date.

 

My first thought was a nested if or switch of some sort - but I don't want to mess up the math that's going on in that measure. Any ideas in the right direction would be extremely helpful.

 

~heathernicoale
1 REPLY 1
Anonymous
Not applicable

@heathernicole,

I am not quite clear about your logic. Could you please tell us the relationships among the three tables you mentioned(sample table, Data, Week End schedule)? What is the sample data of Running Total COLUMN and what is your expected result for Scheduling Group Column based on the above sample data?

Regards,
Lydia

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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