Forum Discussion
joshua1990
Post Prodigy
4 years agoTime left based on Matrix
Hi all!
I have a table like this:
Work Order Nr
Step 1 - Start
Step 1 - End
Step 2 - Start
Step 2 - End
A100
01.07.2022
B100
01.07.2022
01.08.2022
01...
- 4 years ago
joshua1990 I would start by unpivoting your Step columns. Then the DAX will be far easier. You could use something like MTBF. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586.
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
tamerj1
Community Champion
4 years agoHi joshua1990
how does the source data look like?