Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I don't understand what i'm doing wrong. I'm appling this code to a new column called TW
Solved! Go to Solution.
Hi @Rimo72 ,
The issue is likely with your SEARCH function. When SEARCH can't find the value (e.g. if the row value is blank) this kind of error can appear within LEFT.
You just need adjust your dax formula, please try below dax formula:
TW =
IF (
ISBLANK ( 'Table'[Time Worked] ),
BLANK (),
IF (
SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ),
MID (
'Table'[Time Worked],
SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ) + 1,
SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () )
- SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ) - 2
),
IF (
ISBLANK ( SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () ) ),
BLANK (),
LEFT (
'Table'[Time Worked],
SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () ) - 2
)
)
)
)
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Rimo72 ,
The issue is likely with your SEARCH function. When SEARCH can't find the value (e.g. if the row value is blank) this kind of error can appear within LEFT.
You just need adjust your dax formula, please try below dax formula:
TW =
IF (
ISBLANK ( 'Table'[Time Worked] ),
BLANK (),
IF (
SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ),
MID (
'Table'[Time Worked],
SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ) + 1,
SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () )
- SEARCH ( "(", 'Table'[Time Worked], 1, BLANK () ) - 2
),
IF (
ISBLANK ( SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () ) ),
BLANK (),
LEFT (
'Table'[Time Worked],
SEARCH ( "min", 'Table'[Time Worked], 1, BLANK () ) - 2
)
)
)
)
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks it works.
You are using 'Tickets'[TimeWorked] a lot. Might want to put it in a variable.
Is this a measure or a column?
I do :). Will follow you recomandation. 🙂
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
8 |