Forum Discussion
Anonymous
3 years agoNot applicable
Spare parts replacement date offseting
Hello, We are currently working on a dasboard regarding maintenance of equipment fleet. I have a table (FACT_Partes1) with the following fields (showing data for just one equipment) regarding spare...
- 3 years ago
OFFSET only works on the current visual (or filter context if you want). In order to look up "previous" data you are better off using an index column in your data source.
lbendlin
Super User
3 years agoOFFSET only works on the current visual (or filter context if you want). In order to look up "previous" data you are better off using an index column in your data source.
- Anonymous3 years agoNot applicable
Yes, you are right.
Thanks to your advice I took a different approach:
- Sorted spare parts table by equipment, then by spare part code and then by date.
- Gave this table and index column
- Then added a calculated column:
Fecha de cambio de parte = IF ( LOOKUPVALUE ( FACT_Partes1[SCO], FACT_Partes1[Index], FACT_Partes1[Index] ) = LOOKUPVALUE ( FACT_Partes1[SCO], FACT_Partes1[Index], FACT_Partes1[Index] + 1 ) && LOOKUPVALUE ( FACT_Partes1[Equipo], FACT_Partes1[Index], FACT_Partes1[Index] ) = LOOKUPVALUE ( FACT_Partes1[Equipo], FACT_Partes1[Index], FACT_Partes1[Index] + 1 ), LOOKUPVALUE ( FACT_Partes1[Fecha], FACT_Partes1[Index], FACT_Partes1[Index] + 1 ), MAX(FACT_Indicadores[Fecha]) )This achieved the desired result.
Thanks a lot