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
corange
Post Patron
Post Patron

Variación entre dos períodos - dinámico

Hola a todos,

Espero que alguien pueda proporcionar alguna orientación aquí.

Estoy tratando de lograr las cosas:

1) Calcular la varianza entre dos períodos en un montn. A continuación, quiero visualizar el recuento de trabajos para cada período y la varianza en una tabla mátrica y esto para todo el ejercicio. Así es como se ve mi mesa:

Capture.PNG

* Nota - en la misma matriz, también tengo ingresos mostrados. El conjunto de datos se estructura de una manera en la que tengo categoría desglosada en Recuento de trabajos e Ingresos y el valor se agrupa en una columna.

2) Me gustaría calcular el gasto promedio por día para cada período y calcular la diferencia con el gasto histórico de ave por día. Aquí también, deseo usar una matriz para mostrar mi resultado para todo el fY.

Por favor, avísame si puedes ayudar.

Gracias.

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hola

Por favor, pruebe esta columna calculada primero:

MonthDayCount = DAY(DATE('Table'[FY Year],'Table'[MonthNo]+1,1)-1)

A continuación, pruebe estas dos medidas:

Average PerDay = SUM('Table'[Value])/MAX('Table'[MonthDayCount])
Average PerDay Difference =
VAR a =
    IF (
        MAX ( 'Table'[MonthNo] ) - 1 <> 0,
        CALCULATE (
            [Average PerDay],
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Period] IN FILTERS ( 'Table'[Period] )
                    && 'Table'[FY Year] IN FILTERS ( 'Table'[FY Year] )
                    && 'Table'[MonthNo]
                        = MAX ( 'Table'[MonthNo] ) - 1
            )
        ),
        [Average PerDay]
    )
RETURN
    ( [Average PerDay] - a ) / a

El resultado muestra:

3.PNG

Aquí está mi archivo pbix de prueba:

pbix

Espero que esto ayude.

Saludos

Giotto

View solution in original post

3 REPLIES 3
v-gizhi-msft
Community Support
Community Support

Hola

Por favor, pruebe esta columna calculada primero:

MonthDayCount = DAY(DATE('Table'[FY Year],'Table'[MonthNo]+1,1)-1)

A continuación, pruebe estas dos medidas:

Average PerDay = SUM('Table'[Value])/MAX('Table'[MonthDayCount])
Average PerDay Difference =
VAR a =
    IF (
        MAX ( 'Table'[MonthNo] ) - 1 <> 0,
        CALCULATE (
            [Average PerDay],
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Period] IN FILTERS ( 'Table'[Period] )
                    && 'Table'[FY Year] IN FILTERS ( 'Table'[FY Year] )
                    && 'Table'[MonthNo]
                        = MAX ( 'Table'[MonthNo] ) - 1
            )
        ),
        [Average PerDay]
    )
RETURN
    ( [Average PerDay] - a ) / a

El resultado muestra:

3.PNG

Aquí está mi archivo pbix de prueba:

pbix

Espero que esto ayude.

Saludos

Giotto

amitchandak
Super User
Super User

@corange

Puede ver usando Rank puede ayudar. Como he usado durante semanas. Espero que tengas calendario con períodos

https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0

Greg_Deckler
Super User
Super User

Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.