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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.