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.
Hola, chicos
Espero que puedas ayudarme, tengo esta tabla:
los datos no siempre están ordenados por lo que, estoy buscando el nombre del operador donde el id es el más alto: esto el siguiente i fue capaz de obtener el nombre del operador por max wellid,
_CURRENT =
VAR TOPWELL = MAX('Well List'[WellID])
VAR _topclient =
CALCULATE(MAX('Well List'[Operator]), KEEPFILTERS( FILTER( ALL('Well List'[WellName], 'Well List'[Operator], 'Well List'[WellID]), 'Well List'[WellID] = TOPWELL)))
return _topclient
¿cómo puedo identificar en la tabla principal a todos los operadores con el nombre como resultado de la medida? Lo intenté:
IF( _topclient IN VALUES(Operator name), 1, 0)
pero esto devuelve todos los valores como 1. ¿Alguna idea?
Solved! Go to Solution.
Hola @edgarcalgary ,
Por favor, intente crear una columna calculada con la siguiente fórmula para reemplazar la medida original:
Column =
VAR _topclient =
CALCULATE (
MAX ( 'Well List'[Operator] ),
FILTER (
ALL ( 'Well List' ),
'Well List'[WellID] = MAX ( 'Well List'[WellID] )
)
)
RETURN
IF ( 'Well List'[Operator] = _topclient, 1, 0 )
Saludos
Rena
Hola
Comparte el enlace desde donde puedo descargar tu archivo PBI.
@edgarcalgary - No estoy seguro de entender completamente, pero tal vez esto:
Medidas: IF(MAX([Operador]) - [_CURRENT],1,0)
si sólo devuelvo la variable _topclient:
_CURRENT =
VAR TOPWELL = MAX('Well List'[WellID])
VAR _topclient =
CALCULATE(MAX('Well List'[Operator]), KEEPFILTERS( FILTER( ALL('Well List'[WellName], 'Well List'[Operator], 'Well List'[WellID]), 'Well List'[WellID] = TOPWELL)))
return _topclient
el resultado es el siguiente:
por lo que parece que está filtrando fila por fila y no dando el resultado adecuado.
@edgarcalgary - Todavía estoy 100% claro, pero es posible que necesite un ALL o ALLEXCEPT allí para salir del contexto actual de la imagen / fila.
¿Alguna idea de dónde debo aplicarlo?
Hola @edgarcalgary ,
Por favor, intente actualizar la fórmula de medida como se muestra a continuación:
Flag =
VAR TOPWELL =
CALCULATE ( MAX ( 'Well List'[WellID] ), ALL ( 'Well List' ) )
VAR _topclient =
CALCULATE ( MAX ( 'Well List'[Operator] ), 'Well List'[WellID] = TOPWELL )
RETURN
IF ( MAX ( 'Well List'[Operator] ) = _topclient, 1, 0 )
Saludos
Rena
Hola @yingyinr ,
Gracias por su respuesta, ya lo intenté de esa manera antes con el resultado, pero, veo en su ejemplo que tiene dos "JJ", así que básicamente ¿ cómo agregaría el valor 1 en todos los JJ en la columna?
Hola @edgarcalgary ,
Por favor, intente crear una columna calculada con la siguiente fórmula para reemplazar la medida original:
Column =
VAR _topclient =
CALCULATE (
MAX ( 'Well List'[Operator] ),
FILTER (
ALL ( 'Well List' ),
'Well List'[WellID] = MAX ( 'Well List'[WellID] )
)
)
RETURN
IF ( 'Well List'[Operator] = _topclient, 1, 0 )
Saludos
Rena
@yingyinr No entiendo por qué todos estamos después de crear la columna cuando measure puede hacer el trabajo. ¿Entendemos la diferencia entre crear medida frente a columnas y cómo tiene un impacto en el modelo?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@edgarcalgary @yingyinr solución debería funcionar, no estoy seguro de por qué no muestra 1 para cada operador de JJ, creé datos de muestra y utilicé la siguiente medida
Top Operator =
VAR __topId = CALCULATE ( MAX ( Well[Id] ), ALL ( Well ) )
VAR __topOpertor = CALCULATE ( MAX ( Well[Operator] ), Well[Id] = __topId )
RETURN IF ( MAX ( Well[Operator] ) = __topOpertor, 1, 0 )
Me gustaría❤ elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
⚡Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionadas con Power BI.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hola @Greg_Deckler ,
Gracias por su respuesta, todavía tengo el mismo resultado que 1, sé que Max va a interviar fila por fila, pero preguntándome por qué no reconocer la variable _topclient.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |