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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rmcneish
Helper I
Helper I

How to create a string measure with conditions (non number)

Hello everybody

I come here so that you can help me, please. 

I want to create a measure using strings columns as a conditions, and this turn me a result a string value from other string column.

You can see this picture below.

 

String measure.png

 

I hope you can help me soon.

Regards.

 

 

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

Hi @rmcneish ,
Try this: 

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
NathanielPlanta.PNG

 

M1 =
IF (
    MAX ( ZQM_CNTL_P_DIARI[OPERACION] ) = "INSPECCIÓN CALIDAD"
        && MAX ( ZQM_CNTL_P_DIARI[CARACTERISTICA] ) = "CALIDAD ESTIMADA PLANTA",
    MAX ( ZQM_CNTL_P_DIARI[VALOR_TXT] )
)

 And if the string you are looking for, is a subset of the string, and you only want "CALIDAD ESTIMADA" then use this.

M1 =
IF (
    MAX ( ZQM_CNTL_P_DIARI[OPERACION] ) = "INSPECCIÓN CALIDAD"
        && CONTAINSSTRING ( MAX ( ZQM_CNTL_P_DIARI[CARACTERISTICA] ), "CALIDAD ESTIMADA" ),
    MAX ( ZQM_CNTL_P_DIARI[VALOR_TXT] )
)








Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Nathaniel_C
Super User
Super User

Hi @rmcneish ,
Try this: 

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
NathanielPlanta.PNG

 

M1 =
IF (
    MAX ( ZQM_CNTL_P_DIARI[OPERACION] ) = "INSPECCIÓN CALIDAD"
        && MAX ( ZQM_CNTL_P_DIARI[CARACTERISTICA] ) = "CALIDAD ESTIMADA PLANTA",
    MAX ( ZQM_CNTL_P_DIARI[VALOR_TXT] )
)

 And if the string you are looking for, is a subset of the string, and you only want "CALIDAD ESTIMADA" then use this.

M1 =
IF (
    MAX ( ZQM_CNTL_P_DIARI[OPERACION] ) = "INSPECCIÓN CALIDAD"
        && CONTAINSSTRING ( MAX ( ZQM_CNTL_P_DIARI[CARACTERISTICA] ), "CALIDAD ESTIMADA" ),
    MAX ( ZQM_CNTL_P_DIARI[VALOR_TXT] )
)








Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




v-frfei-msft
Community Support
Community Support

Hi @rmcneish ,

 

Please try to create a measure as below.

String measure =
VAR a =
    VALUES ( table2[INSPECCION CALIDAD] )
VAR b =
    VALUES ( table2[CALIDAD ESTIMADA] )
RETURN
    CALCULATE (
        MAX ( table[VALOR TXT] ),
        FILTER ( table, table[OPERACION] IN a && table[CARATERISTICA] IN b )
    )

If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft, first many thanks for aks me.

 

I tried to do but It doesn't work yet, basically i need the measure gives me a texts as a result.

respon.png

 Here you can find my data.

https://1drv.ms/u/s!Aq7YSdznILZYjyytI9VXF6NEoMdH?e=VTtAKe 

 

I hope to read you soon.

Regards.

Anonymous
Not applicable

Hi @rmcneish ,
 

Hope this help you

NewTable-name =
SUMMARIZE
(
FILTER('Table_Name','Table_Name''[Operaction ] = "inspeccion calidad"  &&
 'Table_Name''[caracteristica] = "calidad estimada")
,'Table_Name''[valor_Txt]
,'Table_Name''[Merknr ]
,'Table_Name''[fe_regist]
)
 
Regards
Sac

 

@Anonymous Thanks for have answered my problem.

I need to create a "measure" (not table, I am using a matrix chart) with only these condicions, actually I have many measures and just need this string measure.

 

I hope that you could help me.

Regards.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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