Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I have two dates that I need to determine the number of days between in a Sales Table and a Claim Table by serial number. Below is sample data for a Sales and Claim table. What I need to find is the number of days between the Sale Date on the Sales table and the FIRST Failure Date on the Claim Table if the Claim Type is Standard or Extended.
Sales Table
| Serial # | Sale Date |
| Serial1 | 1/2/2018 |
| Serial2 | 2/14/2019 |
| Serial3 | 9/24/2018 |
| Serial4 | 12/16/2017 |
| Serial5 | 3/1/2017 |
| Serial6 | 4/12/2019 |
| Serial7 | 11/18/2019 |
Claim Table
| Serial # | Claim # | Claim Type | Failure Date |
| Serial1 | Claim1 | Install | 2/1/2018 |
| Serial1 | Claim2 | Standard | 1/13/2019 |
| Serial2 | Claim3 | Startup | 3/14/2019 |
| Serial3 | Claim4 | Standard | 3/6/2019 |
| Serial3 | Claim5 | Standard | 10/1/2019 |
| Serial4 | Claim6 | Startup | 3/5/2017 |
| Serial4 | Claim7 | Standard | 2/11/2018 |
| Serial5 | Claim8 | Standard | 2/14/2019 |
| Serial5 | Claim9 | Extended | 7/6/2019 |
Appreciate any help!
Thanks
Solved! Go to Solution.
Hi @szub
try a measure
Measure =
var _firstFailure = calculate(min('Claim Table'[Failure Date]), OR('Claim Table'[Claim Type]="Standard",'Claim Table'[Claim Type]="Extended"))
return
datediff(selectedvalue('Sales Table'[Sale Date]),_firstFailure,DAY)
Hi @szub,
You can create one measure as below:
bdays = VAR a = MAX ( 'Claim'[Serial #] ) VAR b = DATEDIFF ( CALCULATE ( MAX ( 'Sales'[Sale Date] ), FILTER ( 'Sales', 'Sales'[Serial #] = a ) ), CALCULATE ( MIN ( 'Claim'[Failure Date] ), FILTER ( 'Claim', ( 'Claim'[Claim Type] = "Standard" || 'Claim'[Claim Type] = "Extended" ) && 'Claim'[Serial #] = a ) ), DAY ) RETURN b |
Best Regards
Rena
Hi @szub
try a measure
Measure =
var _firstFailure = calculate(min('Claim Table'[Failure Date]), OR('Claim Table'[Claim Type]="Standard",'Claim Table'[Claim Type]="Extended"))
return
datediff(selectedvalue('Sales Table'[Sale Date]),_firstFailure,DAY)
So something like:
Column = MINX(RELATEDTABLE('Claim Table'),[Failure Date])
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |