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
ansa_naz
Continued Contributor
Continued Contributor

Total de ejecución - desde el inicio del ejercicio hasta el final del mes en curso - pero no funciona

Sigue funcionando desde el inicio del ejercicio seleccionado en el filtro de páginas, hasta el final del ejercicio seleccionado en el filtro de página. Lo necesito para ir desde el inicio del ejercicio seleccionado en el filtro de páginas, hasta el final del mes actual. Mi medida es:

YTD Sales = 

    CALCULATE (
        sum(Revenue[Amount]), 
        DATESYTD(ForecastSalesDate[CalendarDate],"31/10")
    )

Cuando selecciono el ejercicio 2020 en el filtro de páginas, quiero que se muestre desde 01/11/2019 hasta 30/04/2020 (hoy es 16/04/2020), pero sigue yendo a 31/10/2020 (fin del año financiero):

cTjLvGA1tB.jpg

Lo que estoy buscando es:

YearMonth2Ventas de YTD
2019-11656,105
2019-121,032,637
2020-011,732,107
2020-023,904,887
2020-034,973,156
2020-045,064,032

El modelo de datos es:

qAJ2Wky6Pa.jpg

¿Alguien puede aconsejar más?

Salud por toda ayuda

1 ACCEPTED SOLUTION
ansa_naz
Continued Contributor
Continued Contributor

Tengo una solución: agregue un filtro de fecha relativa a la página, para mostrar solo los últimos X meses de datos. Resuelto

View solution in original post

6 REPLIES 6
ansa_naz
Continued Contributor
Continued Contributor

Tengo una solución: agregue un filtro de fecha relativa a la página, para mostrar solo los últimos X meses de datos. Resuelto

v-frfei-msft
Community Support
Community Support

Hola @ansa_naz ,

Podemos usar una medida como esa para trabajar en ella. Para obtener más información, consulte este caso.

https://community.powerbi.com/t5/Desktop/Filter-by-date-in-bar-chart/m-p/1026266#M483925

Year = 
VAR today =
    TODAY ()
VAR stofyear =
    DATE ( YEAR ( today ), 1, 1 )
VAR spre =
    DATE ( YEAR ( today ) - 1, 1, 1 )
VAR pre =
    EDATE ( today, -12 )
RETURN
    CALCULATE (
        SUM ( 'Table'[value] ),
        FILTER (
            'date',
            OR (
                'date'[Date] >= stofyear
                    && 'date'[Date] <= today,
                'date'[Date] >= spre
                    && 'date'[Date] <= pre
            )
        )
    )

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hola @v-frfei-msft He probado su solución de la siguiente manera:

YTD Sales Frank =
VAR today =
    TODAY ()
VAR stofyear =
    MIN ( ForecastSalesDate[CalendarDate] )
RETURN
    CALCULATE (
        SUM ( ANSAPBIProjectFRevenue[Amount] ),
        FILTER (
            ForecastSalesDate,
            ForecastSalesDate[CalendarDate] >= stofyear
                && ForecastSalesDate[CalendarDate] <= today
        )
    )

Sin embargo, esto no me está dando un total de ejecución, sólo me da un total de ventas por mes, y luego incluye los siguientes meses también como valores en blanco:

Frank1.jpg

Lo que estoy tratando de conseguir es:

YearMonth2Ventas de YTD
2019-11656,105
2019-121,032,637
2020-011,732,107
2020-023,904,887
2020-034,973,156
2020-045,064,032

Cualquier otra idea sería muy útil por favor, muchas gracias

jthomson
Solution Sage
Solution Sage

¿No podría usar eomonth y hoy para extraer la última fecha en la que se encuentra como una variable, y luego usarlo como parte de una instrucción if, devolver la medida existente si cualquier campo que está usando está antes de esa fecha y en blanco si lo persigue?

Greg_Deckler
Super User
Super User

Vea si mi Inteligencia del Tiempo el Camino Duro proporciona una manera diferente de lograr lo que usted está buscando.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ 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...

@Greg_Deckler No conseguimos encontrar tu ubicación exacta.

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.

Top Kudoed Authors