Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
64 | |
50 | |
36 | |
26 |
User | Count |
---|---|
80 | |
57 | |
45 | |
44 | |
35 |