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
Pfoerster
Helper III
Helper III

Luchando con YTD

Hola

Estoy tratando de construir un informe, que me muestra las ventas de YTD hasta un mes elegido.

En mi informe, estoy trabajando con dos cuadros, que no están vinculados (por algunas razones relativas a las cifras de existencias): uno con toda mi información, segunda tabla sólo con mes (de enero a diciembre).

Ahora, el usuario debe poder usar la segmentación de mes y elegir, por ejemplo, julio, y en el informe, las ventas YTD de julio deben producirse.

Estoy usando la siguiente medida:

En realidad YTD (VAR _Curr_month - SELECTEDVALUE('Monat'[Month])
devolución
calculate(sum(Combined[SalesVolume]),Filter(Combined,Combined[Scenario]-"Actual"),FILTER(Combined,Combined[Type]-"3rd"),Combined[Month] <- _Curr_month ))
Esta medida debe seleccionar solo las cifras reales y las ventas a la 3a partie para todo el mes <- la que elija. Desafortunadamente, como resultado tengo cifras, que no hacen ninguna sence y yo absolutamente no tengo idea, lo que está mal.
Gracias por cualquier pista y ayuda.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Pfoerster, ¿tiene fecha o si puede crear una fecha.

fecha: date([year],[month],1) //month es un número

¿Cómo hacer cuando mmm o mmmm -https://youtu.be/yPQ9UV37LOU

Inteligencia del tiempo

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hola @Pfoerster ,

Intente rehacer la medida para:

Actuals YTD =
 (
    VAR _Curr_month =
        SELECTEDVALUE ( 'Monat'[Month] )
    RETURN
        CALCULATE (
            SUM ( Combined[SalesVolume] ),
            FILTER (
                Combined,
                Combined[Scenario] = "Actual"
                    && Combined[Type] = "3rd"
                    && Combined[Month] <= _Curr_month
            )
        )
)


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

@Pfoerster, ¿tiene fecha o si puede crear una fecha.

fecha: date([year],[month],1) //month es un número

¿Cómo hacer cuando mmm o mmmm -https://youtu.be/yPQ9UV37LOU

Inteligencia del tiempo

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

Sí, perfecto. Ese fue un buen consejo:

Agredo una nueva columna a mi tabla de información que me da el número de Mes (Enero 1...). Luego, creé otra nueva medida, que transforma el mes seleccionado también en un número, y después de eso, el formulario de ventas con < funciona bien. ¡Gracias!

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.