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
johnmelbourne
Helper V
Helper V

Utilice aplazamientos y seacrh o ... o algo diferente

Hola

Estoy buscando diferentes funciones para hacer lo siguiente, tal vez usando countrows y buscar o encontrar, pero no estoy obteniendo la sintaxis correcta.

En inglés, encuentre dónde


Totalmente exitoso: CALCULATE([MeasureName], Category[Category] á "Completado y se ha mantenido correctamente" Categoría[Categoría] - "Completado y a la izquierda con éxito")

Lo anterior funciona bien, pero estoy buscando hacer una manera diferente usando nuevas funciones.

Cualquier ayuda apreciada.

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hola @johnmelbourne ,

Puede crear una medida como se indica a continuación:

_Total successful = 
var _search1=SEARCH("Successfully completed and stayed",MAX('Category'[Category]),1,0)
var _search2=SEARCH("Successfully completed and left",MAX('Category'[Category]),1,0)
Return
CALCULATE([Measure name],FILTER('Category',_search1<>0||_search2<>0))

O una medida como se indica a continuación:

_Total successful 1 = 
var _search=CALCULATE(COUNTROWS(FILTER('Category','Category'[Category]=MAX('Category'[Category]))),'Category'[Category]="Successfully completed and stayed" || Category[Category] = "Successfully completed and left")+0
Return
CALCULATE('Category'[Measure name],FILTER('Category',_search<>0))

Saludos
Kelly

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

View solution in original post

5 REPLIES 5
v-kelly-msft
Community Support
Community Support

Hola @johnmelbourne ,

Puede crear una medida como se indica a continuación:

_Total successful = 
var _search1=SEARCH("Successfully completed and stayed",MAX('Category'[Category]),1,0)
var _search2=SEARCH("Successfully completed and left",MAX('Category'[Category]),1,0)
Return
CALCULATE([Measure name],FILTER('Category',_search1<>0||_search2<>0))

O una medida como se indica a continuación:

_Total successful 1 = 
var _search=CALCULATE(COUNTROWS(FILTER('Category','Category'[Category]=MAX('Category'[Category]))),'Category'[Category]="Successfully completed and stayed" || Category[Category] = "Successfully completed and left")+0
Return
CALCULATE('Category'[Measure name],FILTER('Category',_search<>0))

Saludos
Kelly

¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!

CNENFRNL
Community Champion
Community Champion

Hola, @johnmelbourne, una alternativa fundamental a su medida es como

Total successful =
CALCULATE (
    [MeasureName],
    Category[Category]
        IN { "Successfully completed and stayed", "Successfully completed and left" }
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

AllisonKennedy
Super User
Super User

Hola Juan

Lo siento, ¿no estoy siguiendo lo que necesitas? En inglés encontrar donde el .... ¿Querías escribir más allí?

¿Solo está buscando aprender más funciones de DAX o hay un requisito de negocio futuro/ adicional que le inspira a cambiar una medida que está funcionando actualmente?

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hola

Lo siento, sólo mecanograme a la mitad que parece.

En inglés, estoy tratando de escribir una medida donde dice encontrar donde la categoría contiene las palabras "Completado con éxito".

Sólo intento aprender una nueva forma de sumar valores cuando una ceteria contiene una parte de una cadena.

Así que, por ejemplo; ¿qué búsqueda? / encontrar ? / partido ? Función DAX utilizaría para calcular
Suma [Ventas] donde Product[ProductName] contiene la palabra "health"

Cuando los nombres de los productos pueden ser

Gel de salud

Calcetines de salud

Salud general

Salud física

Salud mental

Cualquier ayuda apreciada.

Usted puede tratar de

Measure =
CALCULATE (
    COUNTROWS ( 'Product' ),
    SEARCH ( "health", 'Product'[ProductName],, FALSE () )
)

MATCH() no está disponible en la función nativa de DAX lib. Al igual que Excel, SEARCH() no distingue mayúsculas de minúsculas, mientras que FIND() es así.


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

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.