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.
Mi conjunto de datos tiene el siguiente aspecto:
Artículo | Segmento | Ventas totales |
Sandía | Caro | 100 |
Fresa | Caro | 200 |
Plátano | Barato | 300 |
Naranja | Barato | 200 |
Me gustaría crear una medida que calcule las ventas totales para ese segmento en función del artículo que elija. Aquí está el resultado deseado:
Artículo | Total del segmento |
Sandía | 300 |
Fresa | 300 |
Plátano | 500 |
Naranja | 500 |
¿Cómo hago esto? Básicamente necesito un SUM(...) , ALLEXCEPT(... Segment..), pero necesito encontrar el segmento correcto basado en el artículo (por ejemplo, Sandía es "Caro" pero El plátano es "Cheap").
¡Gracias!
Solved! Go to Solution.
Una variable puede leer el segmento y podemos usarlo en la medida.
Segement Total =
VAR _Segment = SELECTEDVALUE('Table'[Segment])
RETURN
CALCULATE(
SUM('Table'[Total sales]),
ALLEXCEPT('Table','Table'[Segment]),
'Table'[Segment] = _Segment
)
Una variable puede leer el segmento y podemos usarlo en la medida.
Segement Total =
VAR _Segment = SELECTEDVALUE('Table'[Segment])
RETURN
CALCULATE(
SUM('Table'[Total sales]),
ALLEXCEPT('Table','Table'[Segment]),
'Table'[Segment] = _Segment
)
¡Muchas gracias! Esto es increíble.
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 |