cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Fila mínima, máxima y media

Hola

Tengo a continuación la tabla de datos en PBI -

ABC
Nos 4,080 2,548 860
suyos 5,897 2,191 421
En 1,635 2,808 339
Uk 754 1,359 629

Quiero obtener Min, Max y Avg de la columna A, B y C en fila como abajo en PBI -

ABC
Nos 4,080 2,548 860
suyos 5,897 2,191 421
En 1,635 2,808 339
Uk 754 1,359 629
Min 754 1,359 339
máximo 5,897 2,808 629
Avg 2,260 2,083 484

¿Cómo puedo lograrlo? ¡Por favor, ayúdenme!

3 ACCEPTED SOLUTIONS
Super User IV
Super User IV

@Easha ,

min A - Calcular(min(Tabla[A]),allselected(Table))

Max A - Calcular(Amx(Tabla[A]),allselected(Table))

Y así sucesivamente.

Otra forma es despivo de los datos A,B,C son los valores de Nueva Columna Col1 (Con A,b ,C), Valor con Valor

https://radacad.com/pivot-and-unpivot-with-power-bi
Min - Calculate(min(Table[Value]),allexcept(Table,Table[Col1]))

Max - Calculate(max(Table[Value]),allexcept(Table,Table[Col1]))

Calcular medio (promedio(tabla[valor]),allexcept(Tabla,Tabla[Col1]))

pantalla con Mostrar en fila en matriz

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Super User IV
Super User IV

@Easha- Puede despocupar esas columnas o utilizar agregaciones MC

https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Community Support
Community Support

Hola @Easha,

También creo que las columnas no votadas deben ser una manera sencilla de lograr sus necesidades.
Si no desea cambiar la estructura, puede intentar utilizar la siguiente fórmula de cálculo de tabla. (Codigo estos valores en fórmulas y anexo manualmente estas filas agregadas)

Table= 
VAR temp =
    SELECTCOLUMNS (
        { "Min", "Max", "Avg" },
        "Region", [Value],
        "A",
            SWITCH (
                [Value],
                "Min", MINX ( ALL ( 'Table'[A] ), [A] ),
                "Max", MAXX ( ALL ( 'Table'[A] ), [A] ),
                "Avg", AVERAGEX ( ALL ( 'Table'[A] ), [A] )
            ),
        "B",
            SWITCH (
                [Value],
                "Min", MINX ( ALL ( 'Table'[B] ), [B] ),
                "Max", MAXX ( ALL ( 'Table'[B] ), [B] ),
                "Avg", AVERAGEX ( ALL ( 'Table'[B] ), [B] )
            ),
        "C",
            SWITCH (
                [Value],
                "Min", MINX ( ALL ( 'Table'[C] ), [C] ),
                "Max", MAXX ( ALL ( 'Table'[C] ), [C] ),
                "Avg", AVERAGEX ( ALL ( 'Table'[C] ), [C] )
            )
    )
RETURN
    UNION ( 'Table', temp )

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hola @Easha,

También creo que las columnas no votadas deben ser una manera sencilla de lograr sus necesidades.
Si no desea cambiar la estructura, puede intentar utilizar la siguiente fórmula de cálculo de tabla. (Codigo estos valores en fórmulas y anexo manualmente estas filas agregadas)

Table= 
VAR temp =
    SELECTCOLUMNS (
        { "Min", "Max", "Avg" },
        "Region", [Value],
        "A",
            SWITCH (
                [Value],
                "Min", MINX ( ALL ( 'Table'[A] ), [A] ),
                "Max", MAXX ( ALL ( 'Table'[A] ), [A] ),
                "Avg", AVERAGEX ( ALL ( 'Table'[A] ), [A] )
            ),
        "B",
            SWITCH (
                [Value],
                "Min", MINX ( ALL ( 'Table'[B] ), [B] ),
                "Max", MAXX ( ALL ( 'Table'[B] ), [B] ),
                "Avg", AVERAGEX ( ALL ( 'Table'[B] ), [B] )
            ),
        "C",
            SWITCH (
                [Value],
                "Min", MINX ( ALL ( 'Table'[C] ), [C] ),
                "Max", MAXX ( ALL ( 'Table'[C] ), [C] ),
                "Avg", AVERAGEX ( ALL ( 'Table'[C] ), [C] )
            )
    )
RETURN
    UNION ( 'Table', temp )

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

Super User IV
Super User IV

@Easha- Puede despocupar esas columnas o utilizar agregaciones MC

https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Super User IV
Super User IV

@Easha ,

min A - Calcular(min(Tabla[A]),allselected(Table))

Max A - Calcular(Amx(Tabla[A]),allselected(Table))

Y así sucesivamente.

Otra forma es despivo de los datos A,B,C son los valores de Nueva Columna Col1 (Con A,b ,C), Valor con Valor

https://radacad.com/pivot-and-unpivot-with-power-bi
Min - Calculate(min(Table[Value]),allexcept(Table,Table[Col1]))

Max - Calculate(max(Table[Value]),allexcept(Table,Table[Col1]))

Calcular medio (promedio(tabla[valor]),allexcept(Tabla,Tabla[Col1]))

pantalla con Mostrar en fila en matriz

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors