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 everyone,
Need some assistance calculating T values. I thought about using Exponential Regression but maybe that's not the right way. You guys may have a simpler solution.
Scenario:
I have a list of different hadware equipment that have been failling over time. I'm trying to plot these failures based on their actual date but converted to T=X instead of using the date itself.
Chart example:
NOTE: T=0 is given to me as a fixed dataset.
Here is a table example of the data:
Serial Number | Failure Date | Failure Month | Count failures per month | T=0 | T=X (not sure how to calculate this) |
12345 | 02-Dec-2017 | Dec-2017 | 1 | Dec-2016 | T=1 |
12345 | 18-Sep-2019 | Sep-2019 | 2 | Dec-2016 | T=2 |
1378Gb49 | 09-Sep-2019 | Sep-2019 | 2 | Jul-2017 | T=1 |
2894GP20 | 27-Aug-2018 | Aug-2018 | 1 | Apr-2018 | T=1 |
12345 | 26-Feb-2020 | Feb-2020 | 1 | Dec-2016 | T=3 |
You will notice that from the table above, the serial number 12345 failed 3 times in a period of 3 years (T=0 being Dec-2016). Therefore each failure gains a +1 to T=X. However, the T=X calculation should always start from the base T=0 date.
NOTE: Each individual serial number will have their own set of T=X. I have a lot of different serial numbers, the plan is to group all failures by month (independent of serial number). The serial number is only used to properly calculate T=X.
I'm preparing this in Power BI, I'm assuming I will have to use Power Query due to the complexity. I'm not the greatest mathematician out there so I'm probably stuck on something simple to resolve.
Please let me know if this is something you guys can assist. Also, let me know if you require more information and I'll add to this post.
Thank you in advance!
Solved! Go to Solution.
Hi @Anonymous
it looks like a good task for RANKX column:
T =
var _Rank =
RANKX(
FILTER(
'Table',
'Table'[Serial Number]=EARLIER('Table'[Serial Number])
),
'Table'[Failure Date], , ASC
)
RETURN
"T = " & _Rank
Hi @Anonymous ,
Just a supplement to the case of T=0:
T =
VAR _Rank =
RANKX (
FILTER ( 'Table', 'Table'[Serial Number] = EARLIER ( 'Table'[Serial Number] ) ),
'Table'[Failure Date],
,
ASC
)
RETURN
IF (
FORMAT ( 'Table'[T=0], "yyyymm" )
= FORMAT (
CALCULATE (
MIN ( 'Table'[Failure Month] ),
ALLEXCEPT ( 'Table', 'Table'[Serial Number] )
),
"yyyymm"
),
"T = " & _Rank - 1,
"T = " & _Rank
)
Hi @Anonymous
it looks like a good task for RANKX column:
T =
var _Rank =
RANKX(
FILTER(
'Table',
'Table'[Serial Number]=EARLIER('Table'[Serial Number])
),
'Table'[Failure Date], , ASC
)
RETURN
"T = " & _Rank
Hi @az38 ,
My preliminary tests have been successful with your formula.
I'll keep working on it but I think that you got it.
Thank you very much for the great solution.
Cheers!
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 |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |