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
Anonymous
Not applicable

DAX contará la medida DAX con filtros

Hola

Tengo una mesa con Site no, Events, start, end. Creé medidas para el tiempo de inactividad y el tiempo de actividad %.

Me gustaría crear una medida para contar el número de sitios que tienen >99.9 tiempo de actividad para sitios y eventos concretos.

Mi fórmula se ve así, pero no contaba.

CUENTA DE LA CUENTA DE LA TIENE ?
var a - [SuE del sitio]
devolver CALCULATE(DISTINCTCOUNT(ALARM[SITE_NO]),FILTER(ALARM,a>-99.9))
pbi community.JPG

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@BIn3rd Esto parece un problema de agregación de medida. Vea mi artículo de blog sobre eso aquí: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

El patrón es:
MinScoreMeasure ? MINX ( SUMMARIZE ( Tabla, Tabla[Grupo] , "Medida",[SuMeasure] ), [Medida])
MaxScoreMeasure ? MAXX ( SUMMARIZE ( Tabla, Tabla[Grupo] , "Medida",[SuMeasure] ), [Medida])
AvgScoreMeasure - AVERAGEX ( SUMMARIZE ( Tabla, Tabla[Grupo] , "Medida",[SuMeasure] ), [Medida])
etcetera.

En su caso, envolvería su instrucción SUMMARIZE (o GROUPBY) en un COUNTROWS(FILTER(... RESUMEN(...),[Medida]>-99.9))


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Creo que lo tengo. ¡Gracias a los dos! ¡Ustedes son campeones!

TIENE recuento 1.2 ? CALCULATE(COUNTROWS(FILTER(SUMMARIZE(ALARM,ALARM[SITE_NO],"UT%",[Site NUs]),[Site NUs]>99.9)),'Lista de sitios'[CAT]-"CAT-1",ALARM[Tipo de evento]-"Crítico")
TIENE recuento 1.7 ? CALCULATE(COUNTROWS(FILTER(SUMMARIZE(ALARM,ALARM[SITE_NO],"UT%",[Site NUs]),[Site NUs]>99.9)),'Lista de sitios'[CAT]-"CAT-2",ALARM[Tipo de evento]-"Crítico")

pbi community.JPG

amitchandak
Super User
Super User

@BIn3rd , Probar

CUENTA DE LA CUENTA DE LA TIENE ?
Countx(filter(Summarize(ALARM, ALARM[SITE_NO] , "_1", [Site NUs]),[_1]>99.9),[SITE_NO])

O

CUENTA DE LA CUENTA DE LA TIENE ?
var a [SuE del sitio]
devolución
Sumx( values(ALARM[SITE_NO]), CALCULATE(DISTINCTCOUNT(ALARM[SITE_NO]),FILTER(ALARM,a>-99.9))

Greg_Deckler
Super User
Super User

@BIn3rd Esto parece un problema de agregación de medida. Vea mi artículo de blog sobre eso aquí: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

El patrón es:
MinScoreMeasure ? MINX ( SUMMARIZE ( Tabla, Tabla[Grupo] , "Medida",[SuMeasure] ), [Medida])
MaxScoreMeasure ? MAXX ( SUMMARIZE ( Tabla, Tabla[Grupo] , "Medida",[SuMeasure] ), [Medida])
AvgScoreMeasure - AVERAGEX ( SUMMARIZE ( Tabla, Tabla[Grupo] , "Medida",[SuMeasure] ), [Medida])
etcetera.

En su caso, envolvería su instrucción SUMMARIZE (o GROUPBY) en un COUNTROWS(FILTER(... RESUMEN(...),[Medida]>-99.9))


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.