Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Anonymous
Not applicable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Medida DAX para el valor máximo basado en el año
06-17-2020
10:08 AM
Source Community: Power BI
Hola
Tengo un conjunto de datos que tiene valores y el año en que se registró ese valor. Quiero crear una medida que muestre el valor máximo para ese año cuando lo agreda a una tabla. Por ejemplo, mis datos tienen este aspecto:
año | Valor |
2008 | 1 |
2008 | 3 |
2008 | 1 |
2009 | 4 |
2010 | 3 |
2010 | 5 |
2010 | 1 |
2011 | 3 |
2011 | 2 |
2012 | 1 |
Así que la medida que quiero agregaría una columna a la tabla que se ve así:
año | Valor | máximo |
2008 | 1 | 3 |
2008 | 3 | 3 |
2008 | 1 | 3 |
2009 | 4 | 4 |
2010 | 3 | 5 |
2010 | 5 | 5 |
2010 | 1 | 5 |
2011 | 3 | 3 |
2011 | 2 | 3 |
2012 | 1 | 1 |
Lo intenté:
Medida: CALCULATE(MAX('Tabla'[Valor]))
pero solo devuelve el número de la columna Valor.
También necesito hacer lo mismo para Min, pero me imagino que será el mismo DAX sólo con MIN en lugar de MAX.
Gracias
Solved! Go to Solution.
1 ACCEPTED SOLUTION
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020
11:41 PM
Source Community: Power BI

También puede probar
Columna: CALCULATE(MAX('Table'[Value]),GROUPBY('Table','Table'[Value]))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020
12:55 PM
Source Community: Power BI

Gracias, eso funciona.
¿Qué pasa si quiero el promedio de cada año?
año | Valor | Promedio |
2008 | 1 | 1.66 |
2008 | 3 | 1.66 |
2008 | 1 | 1.66 |
2009 | 4 | 4 |
2010 | 3 | 3 |
2010 | 5 | 3 |
2010 | 1 | 3 |
2011 | 3 | 2.5 |
2011 | 2 | 2.5 |
2012 | 1 | 1 |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2020
11:22 PM
Source Community: Power BI

HOLA @SKH19,
Puede probar la siguiente fórmula de medida si funciona:
Measure =
CALCULATE (
AVERAGE ( table[Value] ),
ALLSELECTED ( table ),
VALUES ( table[Year] )
)
Puede cambiar las funciones de agregado para aplicar un modo de resumen diferente en los campos. (min, máx., suma, media...)
saludos
Xiaoxin Sheng
Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources
Recommendations
Subject | Author | Posted | |
---|---|---|---|
08-13-2024 03:42 PM | |||
05-25-2023 06:29 AM | |||
06-05-2023 02:08 PM | |||
12-20-2023 05:45 AM | |||
12-21-2023 04:48 AM |