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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors