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
Syndicate_Admin
Administrator
Administrator

¿Cómo modificar mi expresión LYTD de salida para obtener 2021 jan hasta mar cantidad?

Hola a todos

Por debajo de la expresión sólo me dan cantidad YTD, ¿puedo saber cómo conseguir Jan hasta marzo de 2021 importe total?
Ventas LYTD =
var _max = fecha (año (hoy())-1,mes(hoy()),día (hoy()))
devolución
TOTALYTD(('SALES'[SALES_]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)

admin11_0-1616132624839.png

Paul

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

No @admin11,

Se elimina el archivo .pbix de ejemplo. Por favor, vuelva a subirlo. Por favor, corríjame si mi entendimiento está mal.

Si solo desea sumar las ventas de las que son de enero de 2021 a marzo de 2021, podría utilizar la función "TOTALYTD()" directamente.

Espero que eso es lo que estabas buscando.

Saludos

Yuna

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

@v-yuaj-msft

Apprecaite mucho para querer ayudarme a resolver mi problema, Por cierto necesito su ayuda para resolver el siguiente post, ya que esto es más crítico, Espero que pueda echar un vistazo :-

https://community.powerbi.com/t5/Desktop/How-to-modify-my-LYTD-expression-So-that-i-can-get-Jan-2020...

Syndicate_Admin
Administrator
Administrator

@admin11 , Esta fórmula parece correcta. Debería dar Jan para marchar

Pruebe una de las tres versiones . Dos en comentarios //

LYTD QTY forzado=
var _max = fecha (año (hoy())-1,mes(hoy()),día (hoy()))
devolución
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date',-1,year)),'Date'[Date]<=_max), blank())
O
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)

O
TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)

@amitchandak

He prueba tu expresión :-

LYTD SALES AMIT =
var _max = fecha (año (hoy())-1,mes(hoy()),día (hoy()))
devolución
if(max('Date'[Date])<=_max, CALCULATE(Sum('SALES'[sales]),DATESYTD(dateadd('Date',-1,year)),'Date'[Date]<=_max), blank())
No hay error, pero se muestra nulo

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.