Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Solved! Go to Solution.
Hi @CMoppet
You can use CONTAINSSTRING to identify whether a string contains a keyword, or use SEARCH (case-insensitive) or FIND (case-sensitive) to find the position of a keyword if it is contained within a string.
If you still cannot get the expected result, can you please provide some dummy data in table format that we can work with? Currently it's difficult to understand the calculation process with only the Excel formula.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
@CMoppet , Try a new column like
Days Between Repairs =
VAR CurrentSerialNumber = Breakdowns[SERIAL NUMBER]
VAR CurrentWorkType = Breakdowns[WORK TYPE]
VAR CurrentCreateDate = Breakdowns[CREATED DATE]
VAR PreviousRepairDate =
CALCULATE(
MAX(Breakdowns[CREATED DATE]),
FILTER(
ALL(Breakdowns),
Breakdowns[SERIAL NUMBER] = CurrentSerialNumber
&& Breakdowns[CREATED DATE] < CurrentCreateDate
&& (Breakdowns[WORK TYPE] = "Repair" || Breakdowns[WORK TYPE] = "PM")
&& Breakdowns[FAULT LEVEL2] <> "Cleared by Phone"
)
)
RETURN
IF(
CurrentWorkType = "Repair" && PreviousRepairDate <> BLANK(),
DATEDIFF(PreviousRepairDate, CurrentCreateDate, DAY),
BLANK()
)
Is it because the WORK TYPE fields don;t just contain the words Repair or PM? For example, it will say UK Repair Medium, or FR Repair High. Do I need to add an asterisk or something, to indicate that it's looking for those keywords WITHIN a text string?
Hi @CMoppet
You can use CONTAINSSTRING to identify whether a string contains a keyword, or use SEARCH (case-insensitive) or FIND (case-sensitive) to find the position of a keyword if it is contained within a string.
If you still cannot get the expected result, can you please provide some dummy data in table format that we can work with? Currently it's difficult to understand the calculation process with only the Excel formula.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Thank you so much 🙂 This now works!
Hello, Thanks so much for helping me. Unfortunately, I'm not getting any results from this. Here's what I've got:
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |