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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AlexJB
Frequent Visitor

Need first date from first schedule line in column to be able to create right table. not sure how.

Hi,

 

So below u see some demo data that is needed for this question.

 

I already made a new column Ordernr + itemid to create a unique key so this is also able to be used. what I want to achieve is in the last column. I want for each order+itemid the first scheduled conf date. so where schedule line is 1 I want that date for each schedule line. 

 

It is not the first date because it is possible that the second schedule line is earlier then the first.

 

What I want is to use this date as the first order date for this product.  For some reason it is difficult to get this in a different way. In the end I need to create a date table from these dates and then connect it to this first order date. to be real honest I need to get these schedules line out of the file. but there is alot of other data on different schedule lines which I need. 

 

I hope I am clear.  thanks in advance

 

Ordernritemidschedule lineconf date(new column created) = ordernr +temidWhat I want to get: first order date
1001010110-01-2023100101010-01-2023
1001010212-01-2023100101010-01-2023
1001010312-02-2023100101010-01-2023
1001020110-01-2023100102010-01-2023
1001030112-01-2023100103012-01-2023
1002010114-01-2023100201014-01-2023
1002020115-01-2023100202015-01-2023
1002020212-01-2023100202015-01-2023

 

1 ACCEPTED SOLUTION
AlexJB
Frequent Visitor

I fixed it by creating a new table with only Ordernr + temid and the newly created First order date. Then I removed all rows with null as value. 

To use it in visual I linked my date table to this one and on date level. then another relation from order+temid to order+temid relation to the first table

 

I got the same results as using the data without the extra table and only using the following formula. so for my report the extra step wasnt needed, I still do use it for future calculations.

 

= Table.AddColumn(#"Inserted Merged Column", "First order date", each if [Schedule line] = 1 then [conf date] else null)

View solution in original post

3 REPLIES 3
Bmejia
Super User
Super User

Create a new column

MinDate =
CALCULATE(
     MIN('last date'[conf date]),
         ALLEXCEPT('last date','last date'[new column created) = ordernr +temid]))
AlexJB
Frequent Visitor

I do not see how this works. For now I have

 

= Table.AddColumn(#"Inserted Merged Column", "First order date", each if [Schedule line] = 1 then [conf date] else null)

 

Although this gives for every other schedule line after one null as data. That data has to give the same data as was given in the line of schedule line 1..  So it has to look up the value of the combi order+itemid + schedule line = 1 and give that date for all the other lines..  but I cant get this to work. tried several things already.

AlexJB
Frequent Visitor

I fixed it by creating a new table with only Ordernr + temid and the newly created First order date. Then I removed all rows with null as value. 

To use it in visual I linked my date table to this one and on date level. then another relation from order+temid to order+temid relation to the first table

 

I got the same results as using the data without the extra table and only using the following formula. so for my report the extra step wasnt needed, I still do use it for future calculations.

 

= Table.AddColumn(#"Inserted Merged Column", "First order date", each if [Schedule line] = 1 then [conf date] else null)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors