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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
elmer
Helper I
Helper I

Filtering data in a measure in power BI

Hi to everyone,

I'm practicing the creation of measures in power bi to filter some data. I'm using the FILTER function, but I cannot understand how I can properly filter the data in a way that the measure can identify the values that contains a specific term. 

For example the column "Subject" has different values such as "Math 1", "Math 2", "Math 3" and also "Geography", "Physics", etc... What I need to do is to set the FILTER function in a way that it can identify all the values that contains the word "Math" (including "Math 1", "Math 2", "Math 3"...)

 

Any help?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @elmer ,

 

You can create a measure as below. Below measure will sum marks for all subjects which haging word "Math"

 

Measure = CALCULATE(SUM(Sheet1[Marks]), FILTER(Sheet1, SEARCH("Math",Sheet1[Subject],,0)))
 
If this solves your problem please accept thsi as solution and give khudos.
 
Thanks.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @elmer ,

 

You can create a measure as below. Below measure will sum marks for all subjects which haging word "Math"

 

Measure = CALCULATE(SUM(Sheet1[Marks]), FILTER(Sheet1, SEARCH("Math",Sheet1[Subject],,0)))
 
If this solves your problem please accept thsi as solution and give khudos.
 
Thanks.

Hi @Anonymous , It works! thanks!

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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