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
giorajo
Helper I
Helper I

Mostrar siempre el mismo valor

Tengo una matriz que muestra el nombre de los clientes en las filas y las ventas por mes en la columna.

Screen Shot 2020-08-27 at 3.25.54 AM.png

Tengo una cortadora de año para esta matriz. Tengo una medida que obtiene las ventas de diciembre del año anterior.

Lo que pretendo hacer es agregar otra columna para mostrar las ventas del mes divididas por las ventas de diciembre del año anterior. Mi problema es que las ventas de diciembre no se pueden usar columnas mensuales.

Espero que mi pregunta tenga sentido. Gracias de antemano.

1 ACCEPTED SOLUTION
dedelman_clng
Community Champion
Community Champion

Hola @giorajo

Pruebe este código

Total Sales = CALCULATE(SUM(Sales[Sales]))

Sales Rel to Prev Dec =
VAR __PrevYear =
    YEAR ( MAX ( DateTab[Date] ) ) - 1
VAR __PrevDec =
    CALCULATE (
        [Total Sales],
        DATESBETWEEN (
            DateTab[Date],
            DATE ( __PrevYear, 12, 1 ),
            DATE ( __PrevYear, 12, 31 )
        )
    )
RETURN
    CALCULATE ( DIVIDE ( [Total Sales], __PrevDec ), 0 )

2019 (vs Dic 2018)

2020-08-26 15_12_42-scratch3 - Power BI Desktop.png

2020 (vs Dic 2019)

2020-08-26 15_12_53-scratch3 - Power BI Desktop.png

Espero que esto ayude

David

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hola

Comparte el enlace desde donde puedo descargar tu archivo PBI.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
pranit828
Community Champion
Community Champion

Hola @giorajo

usted tiene que crear una medida para cada mes y el usuario en el gráfico de tabla

Jan_Dec [Ene]/[Calc_December]

Feb_Dec [Febrero]/[Calc_December]

...

Jan_Dec de datos [Dic]/[Calc_December]





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
dedelman_clng
Community Champion
Community Champion

Hola @giorajo

Pruebe este código

Total Sales = CALCULATE(SUM(Sales[Sales]))

Sales Rel to Prev Dec =
VAR __PrevYear =
    YEAR ( MAX ( DateTab[Date] ) ) - 1
VAR __PrevDec =
    CALCULATE (
        [Total Sales],
        DATESBETWEEN (
            DateTab[Date],
            DATE ( __PrevYear, 12, 1 ),
            DATE ( __PrevYear, 12, 31 )
        )
    )
RETURN
    CALCULATE ( DIVIDE ( [Total Sales], __PrevDec ), 0 )

2019 (vs Dic 2018)

2020-08-26 15_12_42-scratch3 - Power BI Desktop.png

2020 (vs Dic 2019)

2020-08-26 15_12_53-scratch3 - Power BI Desktop.png

Espero que esto ayude

David

Muchas gracias, @dedelman_clng !

Muchas gracias, @dedelman_clng!.

Intenté su sugerencia, pero estoy recibiendo este error:

Screen Shot 2020-08-27 at 2.59.35 PM.png

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.