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
CRDover
Frequent Visitor

Is there a way to assign dates in sequences based on an index or similar?

I have a table with an index

 

Current State:

Case #     Priority-Index       Date

1                     1                        

2                      3

3                      2

4                      5

5                      6

 

Ideal State:

Case #     Priority-Index       Date

1                      1                   January 1, 2021

2                      3                   January 3, 2021

3                      2                   January 2, 2021

4                      5                   January 5, 2021

5                      6                   January 6, 2021

6                      4                   January 4, 2021

 

The end state is to streamline the scheduling process of activities

 

I have a tried a couple of ways to use the index to add to earlier value but I keep trigering circular reference errors.

 

Thanks in advance

5 REPLIES 5
Vera_33
Resident Rockstar
Resident Rockstar

Hi @CRDover 

 

Can you explain the logic how you got Jan 1, 2021 for Case 4?

that was a mistake on my part!

Hi @CRDover 

 

Month and Year are hard coded as 1, 2021? If you have other logic to apply, please specify

Add in Power Query

Vera_33_0-1629094613969.png

#date(2021,1,[#"Priority-Index"])

Add as DAX Calculated Column

Vera_33_1-1629094715865.png

DATE(2021,1,'Table'[Priority-Index])

 

Hi Vera, thank you for your contribution on this but I see my attempts to simplify this turned out counterproductive.

 

The priority index cannot be used for day number as it goes into the thousands. I do also have a additional groups that would necesitate restarting the date count, and a capacity that would potentially allow for assigning to cases to the same date. 

 

Example:

 

    Desired Output
CaseGroupPriority-IndexCapacityDate
1A1078210/1/2021
7A1096210/1/2021
8A1099210/4/2021
9A1102210/4/2021
13A1114210/5/2021
14A1117210/5/2021
2B1081510/1/2021
3B1084510/1/2021
4B1087510/1/2021
5B1090510/1/2021
6B1093510/1/2021
10B1105510/2/2021
11B1108510/2/2021
12B1111510/2/2021
15B1120510/2/2021
16B1123510/2/2021

 

I wasn't concerned about those other pieces as there is many ways to handle them if I have a date that can be assigned based on the index.

 

The starting date for the table varies and is dynamic, not hard coded. The groups can be included in the table or not depending on how a formula to assign dates based on the index would work.

 

I know how to build the code to copy based on available capacity. The part that I am missing is the one that I thought would be easiest. Simply adding one day, to the date before when necessary. I.e. when going from 10/1/2021 to 10/02/2021. 

 

Not sure if that helps

 

 

Hi @CRDover 

 

I don't think I understand your logic to add the Date column, if Index goes to thousands or if you simply want to add one day you can use Date.AddDays in M...but to simplify the question, it is better to put sample data as input, and a desired output, and the logic in between.

 

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