Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am working on window panels and they are going to be inspected for the forseeable future based on their Priority levels. I want to show in a calcualted column or measure, the window panels that have changed priority after each inspection. Either up or down.
I cannot figure out how to do it.
HELP 😃
Panel No | Priority | Date Created | Date of Inspection |
1289 | P3 | 04/11/2020 | 04/11/2020 |
1345 | P2 | 04/11/2020 | 05/05/2021 |
1289 | P1 | 04/11/2020 | 06/07/2021 |
5000 | P2 | 12/10/2020 | 01/02/2021 |
5000 | P1 | 12/10/2020 | 12/12/2020 |
5000 | P2 | 12/10/2020 | 12/04/2020 |
Solved! Go to Solution.
@Anonymous This worked for me with your data:
Column =
VAR __Current = RIGHT([Priority],1) * 1
VAR __PreviousDate = MAXX(FILTER('Table3','Table3'[Date of Inspection] < EARLIER('Table3'[Date of Inspection]) && [Panel No]=EARLIER('Table3'[Panel No])),[Date of Inspection])
VAR __Previous = RIGHT(MAXX(FILTER('Table3',[Date of Inspection]=__PreviousDate),[Priority]),1) * 1
RETURN
IF(ISBLANK(__PreviousDate),0,__Current - __Previous) * -1
@Anonymous You are going to want something along the lines of MTBF to compare rows:
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
@Greg_Deckler Thanks for this, unfortunately it is not producing the solution I am looking for/expecting.
I will give an example of what I was hoping to see.
Panel No | Priority | Date Created | Date of Inspection | Priority change |
1289 | P3 | 04/11/2020 | 04/11/2020 | 0 |
1345 | P2 | 04/11/2020 | 05/05/2021 | 0 |
1289 | P1 | 04/11/2020 | 06/07/2021 | 2 |
5000 | P2 | 12/10/2020 | 01/02/2021 | -1 |
5000 | P1 | 12/10/2020 | 12/12/2020 | 1 |
5000 | P2 | 12/10/2020 | 12/04/2020 | 0 |
I don't if that makes sense? The formula above is showing me the difference from the previous panel in the the row above...not the difference JUST for that panel.
@Anonymous This worked for me with your data:
Column =
VAR __Current = RIGHT([Priority],1) * 1
VAR __PreviousDate = MAXX(FILTER('Table3','Table3'[Date of Inspection] < EARLIER('Table3'[Date of Inspection]) && [Panel No]=EARLIER('Table3'[Panel No])),[Date of Inspection])
VAR __Previous = RIGHT(MAXX(FILTER('Table3',[Date of Inspection]=__PreviousDate),[Priority]),1) * 1
RETURN
IF(ISBLANK(__PreviousDate),0,__Current - __Previous) * -1
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |