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

Tasa de éxito (%) por categoría

¡Hola a todos!

Estoy luchando con lo que parece ser una tarea fácil.

Tengo una tabla llamada "éxito" que se parece a la de abajo. Tengo la Categoría y el Resultado, y me gustaría calcular la Tasa de éxito para cada categoría, de tal manera que los números son los indicados en la columna "Tasa de éxito". Probé diferentes métodos con Count y Filter, pero fallé cada vez. ¡Gracias!

Tasa de éxito de resultados de la categoría

AVerdad100%
BFalso0%
DVerdad100%
AVerdad100%
BFalso50%
CFalso50%
EFalso50%
AVerdad100%
EFalso50%
CVerdad50%
1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Bob1410 - Aquí está la columna que pidió. PBIX se adjunta debajo de sig. Tabla (19)

Success Rate = 
    VAR __True = COUNTROWS(FILTER('Table (19)',[Category]=EARLIER([Category]) && [Outcome]))
    VAR __False = COUNTROWS(FILTER('Table (19)',[Category]=EARLIER([Category]) && NOT([Outcome])))
    VAR __Result = DIVIDE(__True,__True+__False,0)
RETURN
    IF(ISBLANK(__Result),0,__Result)

@ 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

2 REPLIES 2
Greg_Deckler
Super User
Super User

@Bob1410 - Aquí está la columna que pidió. PBIX se adjunta debajo de sig. Tabla (19)

Success Rate = 
    VAR __True = COUNTROWS(FILTER('Table (19)',[Category]=EARLIER([Category]) && [Outcome]))
    VAR __False = COUNTROWS(FILTER('Table (19)',[Category]=EARLIER([Category]) && NOT([Outcome])))
    VAR __Result = DIVIDE(__True,__True+__False,0)
RETURN
    IF(ISBLANK(__Result),0,__Result)

@ 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...
amitchandak
Super User
Super User

@Bob1410 ,

Una nueva medida como

Calculate(Divide(calculate(Count(Table[Outcome]),[Outcome] á"TRUE") ,Count(Table[Outcome])), allexcept(Table,Table[Category]))

O una nueva columna


columna ?
var _cnt á countx(filter(Table , [Category] ?earlier([Category])),[Category])
var _cntTR "countx(filter(Table , [Category] ?earlier([Category]) && [Outcome] ?"TRUE"),[Category])
devolución
divide (_cntTR,_cnt)

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.