This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi guys,
I have the following table:
| Name | Value |
| Car One | 100 |
| Car Two | 150 |
| Bike One | 10 |
| Bike Two | 15 |
| Bike Three | 20 |
What I want to do is to calculate all the values that correspond to a field that has the word "bike"in it and divide them by all: For example "Calculate(SUM(Table[Value]), Table[Name]="Bike") this calculation gives me the values that
only use the word "Bike". As a result i would like to have (10+15+20)/(10+15+20+100+150).
Solved! Go to Solution.
Hi @Anonymous
You may create the measure with SEARCH Function.
Measure =
DIVIDE (
SUMX (
FILTER ( Table3, SEARCH ( "Bike", Table3[Name], 1, 0 ) > 0 ),
Table3[Value]
),
SUM ( Table3[Value] )
)
Regards,
Cherie
Hi @Anonymous
You may create the measure with SEARCH Function.
Measure =
DIVIDE (
SUMX (
FILTER ( Table3, SEARCH ( "Bike", Table3[Name], 1, 0 ) > 0 ),
Table3[Value]
),
SUM ( Table3[Value] )
)
Regards,
Cherie
@Anonymous Please try this as a New Measure
Test171 = VAR _BikeSum = SUMX(FILTER(ALL(Test171PatternMatchSum),LEFT(Test171PatternMatchSum[Name],4)="Bike"),Test171PatternMatchSum[Value]) VAR _Total = SUM(Test171PatternMatchSum[Value]) RETURN FORMAT(DIVIDE(_BikeSum,_Total),"#0.00")
Proud to be a PBI Community Champion
If you write "Car"instead the result will be 1 because it takes all the data that has n+ characters. So it will only work if the name is the longest.
@Anonymous The initial question that you have posted is to know the Total Sales that contains Bike in the text.
Please post the appropriate test data and expected output to suggest an accurate solution.
Proud to be a PBI Community Champion
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 27 | |
| 23 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 50 | |
| 30 | |
| 25 | |
| 24 |