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
joaoresende
Frequent Visitor

Contar valores diferentes y dar una clasificación (LOD en power BI)

Hola

Vengo de Tableau y en este uso LOD para clasificar

Tengo esta tabla a continuación y necesito clasificar a cada persona de acuerdo con los valores obtenidos en la columna Clasificación. Por ejemplo, si la persona tiene las 3 clasificaciones "HIGHER" entonces será "Indicado", si tiene hasta dos "INCREASE" y uno "HIGHER" entonces será "INDICATED BUT X" y tiene otras métricas. ¿Cómo puedo hacer esto?

powerbi.png

5 REPLIES 5
az38
Community Champion
Community Champion

Hola @joaoresende

tratar de crear una columna con técnica como esta

Column = 
var _higherCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = "Higher")
var _increaseCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = "Increase")

RETURN

SWITCH(TRUE(),
_higherCount = 3, "Indicated",
_increaseCount  <= 2 _higherCount = 1, "INDICATED BUT X",
"Other"
)


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hola, @az38

Gracias por la respuesta, estaba con un problema cuando trato de usar esta columna. Creo que es porque para obtener la "clasificación" que estaba usando la medida abajo :

Medida:

Classification = 
var percentil = [meanPercentil]
return
LOOKUPVALUE('Classification'[Classification];'Classification'[Percentil];percentil)

Error:

A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.

az38
Community Champion
Community Champion

@joaoresende

también puede crear una medida

Column = 
var _Classification = SELECTEDVALUE(Table[Classification])
var _higherCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = _Classification )
var _increaseCount = CALCULATE(COUNTROWS(Table), ALLEXCEPT(Table, Table[Person_id]), Table[Classification] = _Classification )

RETURN

SWITCH(TRUE(),
_higherCount = 3, "Indicated",
_increaseCount  <= 2 _higherCount = 1, "INDICATED BUT X",
"Other"
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Gracias, probaré esto.

El problema que tengo con la medida es usar en X-asis, no puedo ver en un gráfico.

Te envío una invitación en Linked-In, si tienes tiempo

az38
Community Champion
Community Champion

@joaoresende

así que

que nave para rediseñar su modelo de datos como Medida no se puede utilizar tanto en la expresión de columna como como eje X


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.