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
Syndicate_Admin
Administrator
Administrator

Problema de sintaxis con el argumento TOPN TABLE

Hola.
Tengo una medida que recupera el nombre de la categoría que tiene un valor máximo [Cambiar]. Me gustaría agregar otra dimensión a eso: no solo una categoría, sino también un género y filtrarlo para que sea femenino. por ejemplo, fuera de género (femenino), la categoría 2 tiene un valor máximo, por lo que la salida debe ser: categoría2

TOP nombre del gato =
DÓNDE _top_name = FIRSTNONBLANK(TOPN(1,VALORES(FctTable[Categoría]),[Cambiar]),1)
DEVOLUCIÓN
_top_name

me da un nombre asociado con el valor máximo cuando se trata de una sola dimensión: categoría. Me gustaría agregar un contexto de filtro de género y solo mujeres Intenté ADDCOLUMNS dentro de TOPN pero no funcionó.

¿Quizás debería tener otro enfoque? Cualquier idea y consejo son bienvenidos
1 ACCEPTED SOLUTION

He resuelto mi problema usando la fórmula

CALCULATE( MAX(FctTable[Category]), TOPN(1, FILTER( SUMMARIZE (FctTable, FctTable[Gender], FctTable[Category], "@Chng", [Change]), FctTable[Gender] = "Female"), ABS([Change])) )

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

@Pbiuserr , No muy claro, verifique si uno de los dos puede ayudar

calculate(max(FctTable[Category]) ,TOPN(1,allselected(FctTable[Category]),[Change]), values(FctTable[Category]))

o

calculate([Change] ,TOPN(1,allselected(FctTable[Category]),[Change]), values(FctTable[Category]))

Hola Amit
Me gustaría crear dicha tabla virtualmente y volver a intentar "Categoría" con el valor máximo para el género = "Mujer". "Cambio" es una medida, no una columna si ayuda

Capture.PNG

He resuelto mi problema usando la fórmula

CALCULATE( MAX(FctTable[Category]), TOPN(1, FILTER( SUMMARIZE (FctTable, FctTable[Gender], FctTable[Category], "@Chng", [Change]), FctTable[Gender] = "Female"), ABS([Change])) )

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.