Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
sfernamer
Helper III
Helper III

How to find inside a string to do time calculation

Hi everyone!

 

I'm working with sports data, calculating the time on court for players and would like to calculate time when a specific string (player name) is inside a column. Due to the data structure, I have the info for the full FiveOnCourt and based on positions but not for a player alone. 

 

Here is the example:

 

Player_Times.png

 

As you can see, I have "Player7" who played in different positions so I would like to have one only table with the following values for each player (not needed the order because it's only an example with players with more than one position):

 

PLAYER7 - 1 - 00:17:39 (0:05:26 + 0:12:13) - 41

PLAYER13 - 1 - 0:28:40 (0:21:02 + 0:07:38) - 84

PLAYER...

PLAYER...

 

So, I guess I have to create a measure to find every string inside the FiveOnCourt but I don't know how I could do it. Could you help me, please?

 

I add the link to the raw data and the pbix file: https://drive.google.com/drive/folders/1BxVWCtoHkcQYnDfOpqmYFpFgXpoEIPOt?usp=drive_link 

 

Thank you for your time!

2 REPLIES 2
sfernamer
Helper III
Helper III

Hi @Alef_Ricardo_ 

 

Firstly, I'd like to thank you your time. I just have to tell that need to do it in Power BI instead of Excel, so some of the formulas could not work.

 

Thank you anyway for your time. 🙂

Alef_Ricardo_
Resolver II
Resolver II

Hi there! It looks like you’re trying to find a specific string (player name) within a column in Excel and use that information to calculate the time on court for each player.

 

There are several ways you can do this in Excel, including using functions such as SEARCH, FIND, MATCH, and COUNTIF1234.

 

For example, you can use the SEARCH function to find the position of a specific substring within a text string. The SEARCH function is not case-sensitive and supports wildcards, which can be useful when searching for substrings. You can also use the ISNUMBER function in combination with the SEARCH function to return a TRUE or FALSE result indicating whether the substring was found1.

 

Another option is to use the MATCH function to find the position of a specific value within a range or array. This function can be useful when you want to find the row number of a specific value within a column3.

I hope this information helps! If you need more detailed instructions or examples, I recommend checking out some of the resources I mentioned above. Let me know if you have any further questions 😊.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.