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
RyanLMoran
Helper I
Helper I

Calculating number of times a word (string) is in a dataset

Hello:

 

     I'm looking for some help with a few tables that I have to create.  The first one is this:

Elementary Teacher by Grade Level Report

Teacher names

Grade K

Grade 1

Grade 2

Grade 3

Grade 4

Grade 5

Total

Teacher 1

 

 

 

 

 

 

 

Teacher 2

 

 

 

 

 

 

 

Teacher 3

 

 

 

 

 

 

 

Total

 

 

 

 

 

 

Total

 

The grade levels are not set up with their own data set or column name.  They are created in an LMS section and inside that section they are listed in a name field.  What I need to do is to look through that name field and find all references of the grades and total them to the teacher.  This way we can get a quick snapshot of how many enrollments each teacher has for each grade level.  

For instance, when I run this SQL query in our LMS: SELECT SectionIndex, Name FROM Sections WHERE [Status] = 'ACTIVE' AND TeacherIndex = 143

 

I'm assuming that I need some measure that will look at the string for First Grade, or Second Grade, etc... and count those Active  instances to give me the total that I'm looking to populate in the table that I'm trying to create?

 

It will return this data to me that tells me that this teacher (whom we have given the index number of 143) is teaching these first grade classes: 

RyanLMoran_0-1643329009952.png

I've brought this data in to my PowerBI Space to try and get this data compiled:

RyanLMoran_1-1643329182208.png

 

RyanLMoran_2-1643329212397.png

 

1 REPLY 1
amitchandak
Super User
Super User

@RyanLMoran , Based on what I got

if your data is like the first screenshot. Comma-separated. Then you can split that in power query in rows.

https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/

 

You can also try text filter if that can help

https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104381309?src=office&tab=Overview

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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