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
Ethanhunt123
Helper III
Helper III

N superior solo para categoría específica (Evitar espacios en blanco)

Tengo una tabla que tiene 2 columnas, Test_Name, Test_Value

Test_NameTest_Value
Abc10
Sdf12
Ert14
Asd

Tengo que encontrar el top 1 Test_name basado en el Test_value

Mi DAX se ve así

Prueba de la prueba ( Test)

CALCULAR (
( Test_Name),
TOPN ( 1, ALL(Test_Name) , Test_value DSC),
VALORES ( test_Name )
)
La salida que estoy recibiendo es ASD (que no es correcto, no debe considerar valores en blanco) La salida debe ser ERT
1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hola @Ethanhunt123 ,

Cree una medida como se muestra a continuación:

Measure = 
CALCULATE(MAX('Table'[Test_Name]),TOPN(1,FILTER(ALL('Table'),'Table'[Test_Value]<>BLANK()),CALCULATE(MAX('Table'[Test_Value])),DESC))

Y verás:

Screenshot 2020-09-14 133540.png

Para el archivo .pbix relacionado, pls ver adjunto.


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

View solution in original post

5 REPLIES 5
negi007
Community Champion
Community Champion

@Ethanhunt123 Puede crear una medida simple para obtener el valor con el valor TOP.

Top_Val - LOOKUPVALUE ('Top N'[Test_Name],'Top N'[Test_Value],Max ('Top N' [Test_Value]))
negi007_0-1600063341778.png




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



Proud to be a Super User!


Follow me on linkedin

v-kelly-msft
Community Support
Community Support

Hola @Ethanhunt123 ,

Cree una medida como se muestra a continuación:

Measure = 
CALCULATE(MAX('Table'[Test_Name]),TOPN(1,FILTER(ALL('Table'),'Table'[Test_Value]<>BLANK()),CALCULATE(MAX('Table'[Test_Value])),DESC))

Y verás:

Screenshot 2020-09-14 133540.png

Para el archivo .pbix relacionado, pls ver adjunto.


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

PaulDBrown
Community Champion
Community Champion

@Ethanhunt123

Utilice RANKX en lugar de TopN

Rank Value = RANKX(ALL('TopN'), [Sum of Value],,DESC)

result.JPG

y si desea una medida solo para el nombre superior:

Top Name for Card Visual = CALCULATE(MAX('TopN'[Test_Name]), FILTER('TopN', [Rank Value] = 1))

card vis.JPG





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@Ethanhunt123 , Trate de medidas como

measure: calculate(sum(Test_Value), filter(Table,not(isblank(Table[Test_Value]))))

CALCULAR (
[medida],
TOPN ( 1, ALL(Test_Name) , [measure] DSC),
VALORES ( test_Name )
)

La salida sería Test_name, Esto todavía me está dando TEST_Name con el valor en blanco

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.