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
Anonymous
Not applicable

calculation with search

Current data in table visual 
ColumnA MeasureB ------------------------------------ 0 4323.02.03.02 194544 8 70855 6 60234.04.03.03 169855 -99

goal is to get the result in table visual to be

ColumnA MeasureB MeasureC
-------------------------------------------------
0
4323.02.03.02
194544 8
70855 6 6
60234.04.03.03 2 2
169855 -99

Question:
I would like to add a new measure into the table visual called MeasureC so that it has a value as same as MeasureB if ColumnA value starts with 6 or above, otherwise 0
This is what I have but it gives all rows in measureC as -99 which is wrong

MeasureC =
-1 * CALCULATE([MeasureB]
, SEARCH("6*", 'Table'[ColumnA],1, 0) > 0
|| SEARCH("7*", 'Table'[ColumnA],1, 0) > 0
|| SEARCH("8*", 'Table'[ColumnA],1, 0) > 0
|| SEARCH("9*", 'Table'[ColumnA],1, 0) > 0
)



Can you help please?
Thank you

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi fmbg,

Did you want to get below result?

208.PNG

If so, you could try below measure to see whether it work or not

Measure 3 =
IF ( VALUE ( LEFT ( MIN ( 'search'[Column A] ), 1 ) ) >= 6, [Measure 2], 0 )

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
dax
Community Support
Community Support

Hi fmbg,

Did you want to get below result?

208.PNG

If so, you could try below measure to see whether it work or not

Measure 3 =
IF ( VALUE ( LEFT ( MIN ( 'search'[Column A] ), 1 ) ) >= 6, [Measure 2], 0 )

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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