March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi
I have a table withproperty ref, Job number, Job description, Supplier, Date logged. We have suppliers who carry out repairs at individual properties. Sometimes they will carry out more than one repair at the same property over time.
I would like either a power query solution or DAX function that check the property reference , job desctiption and supplier name.
If these appear more than once I would like to calculate the number of days from when the job was previously logged. Row by Row.
Some properties will have up to 10 jobs logged agains them. In this example there are 2 properties each one has a the same supplier who carried out 4 repairs. The last column is the result that I would expect
The example below is a snapshot of the table
Property Ref | Job# | Job Description | Supplier Name | Date Logged | Days between last Date Logged |
186173 | 6909694 | Electrical Heater | ACME | 23/03/2021 | 1st Job |
186173 | 7054670 | Electrical Heater | ACME | 08/06/2021 | 77 |
186173 | 7085419 | Electrical Heater | ACME | 25/06/2021 | 17 |
186173 | 7134547 | Electrical Heater | ACME | 20/07/2021 | 25 |
80218 | 6779047 | Roof Repair | GFS Roofers | 19/01/2021 | 1st Job |
80218 | 6929155 | Roof Repair | GFS Roofers | 06/04/2021 | 77 |
80218 | 6960307 | Roof Repair | GFS Roofers | 22/04/2021 | 16 |
80218 | 7156921 | Roof Repair | GFS Roofers | 28/07/2021 | 97 |
thank you
Richard
Solved! Go to Solution.
@cottrera , Try a new column like
New column =
var _max = maxx(filter(Table, [Property Ref] = earlier([Property Ref]) && [Date Logged] < earlier( [Date Logged] ) ),[ [Date Logged] )
return
datediff([Date Logged],_max, day)
Thank you works fine 😀
@cottrera , Try a new column like
New column =
var _max = maxx(filter(Table, [Property Ref] = earlier([Property Ref]) && [Date Logged] < earlier( [Date Logged] ) ),[ [Date Logged] )
return
datediff([Date Logged],_max, day)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |