Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
yodha
Helper IV
Helper IV

¿Cómo calcular el costo de balanceo?

Hola

soy muy nuevo en power bi.

Tengo Matrix en mi .pbix así,

y quiero calcular el costo de rodadura, y el resultado final debería ser así,

Cualquier ayuda en esto es muy apreciada.

Gracias por adelantado.

2 ACCEPTED SOLUTIONS
VijayP
Super User
Super User

@yodha

Puede utilizar esta función para obtener la acumulativa.

Estoy compartiendo el PBIX que se puede descargar formulario aquí

Si encuentra esto como solución, mencione esto como solución y comparta sus Kudos.

También puedes ver mis Videos en www.youtube.com/perepavijay

saludos

Vijay Perepa

2020-04-27_131126.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

v-yingjl
Community Support
Community Support

Hola @yodha ,

Puede seguir estos pasos para probar:

1. He creado una columna calculada a la columna de fecha fomat para un cálculo fácil:

Month-Year = VALUE(FORMAT('Table'[Date],"yyyymm"))​

2. He creado una medida para calcular el costo actual para reemplazar la columna anterior porque pensé que era contradictoria al calcular el costo total basado en el mes anterior:

Present cost measure =
VAR _minmonthyear =
    CALCULATE ( MIN ( 'Table'[Month-Year] ), ALLSELECTED ( 'Table' ) )
VAR _cmonthyear =
    SELECTEDVALUE ( 'Table'[Month-Year] )
VAR _lastmonthyear =
    CALCULATE (
        MAX ( 'Table'[Month-Year] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Month-Year] < _cmonthyear )
    )
RETURN
    IF (
        _cmonthyear = _minmonthyear,
        SUM ( 'Table'[Present cost] ),
        CALCULATE (
            SUM ( 'Table'[Present cost] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Categoary] ),
                'Table'[Month-Year] = _minmonthyear
            )
        )
            - CALCULATE (
                SUM ( 'Table'[Forecast cost] ),
                FILTER (
                    ALLEXCEPT ( 'Table', 'Table'[Categoary] ),
                    'Table'[Month-Year] < _cmonthyear
                )
            )
    )
​

3. Por último, cree una medida para calcular el coste total:

Total cost = [Present cost measure]-SUM('Table'[Forecast cost])​

4. Obtendrá el resultado de la siguiente manera:roll cost.png

Aquí está mi archivo de muestra que espera ayudarle, por favor pruébelo: PBIX

Mejores looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hola @yodha ,

Puede seguir estos pasos para probar:

1. He creado una columna calculada a la columna de fecha fomat para un cálculo fácil:

Month-Year = VALUE(FORMAT('Table'[Date],"yyyymm"))​

2. He creado una medida para calcular el costo actual para reemplazar la columna anterior porque pensé que era contradictoria al calcular el costo total basado en el mes anterior:

Present cost measure =
VAR _minmonthyear =
    CALCULATE ( MIN ( 'Table'[Month-Year] ), ALLSELECTED ( 'Table' ) )
VAR _cmonthyear =
    SELECTEDVALUE ( 'Table'[Month-Year] )
VAR _lastmonthyear =
    CALCULATE (
        MAX ( 'Table'[Month-Year] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Month-Year] < _cmonthyear )
    )
RETURN
    IF (
        _cmonthyear = _minmonthyear,
        SUM ( 'Table'[Present cost] ),
        CALCULATE (
            SUM ( 'Table'[Present cost] ),
            FILTER (
                ALLEXCEPT ( 'Table', 'Table'[Categoary] ),
                'Table'[Month-Year] = _minmonthyear
            )
        )
            - CALCULATE (
                SUM ( 'Table'[Forecast cost] ),
                FILTER (
                    ALLEXCEPT ( 'Table', 'Table'[Categoary] ),
                    'Table'[Month-Year] < _cmonthyear
                )
            )
    )
​

3. Por último, cree una medida para calcular el coste total:

Total cost = [Present cost measure]-SUM('Table'[Forecast cost])​

4. Obtendrá el resultado de la siguiente manera:roll cost.png

Aquí está mi archivo de muestra que espera ayudarle, por favor pruébelo: PBIX

Mejores looks,
Yingjie Li

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Greg_Deckler
Super User
Super User

VijayP
Super User
Super User

@yodha

Puede utilizar esta función para obtener la acumulativa.

Estoy compartiendo el PBIX que se puede descargar formulario aquí

Si encuentra esto como solución, mencione esto como solución y comparta sus Kudos.

También puedes ver mis Videos en www.youtube.com/perepavijay

saludos

Vijay Perepa

2020-04-27_131126.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors