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
Paulyeo11
Impactful Individual
Impactful Individual

C1000 ¿Cómo calcular YTD para COGS ?

Hola a todos

Tengo debajo de los datos sin procesar, me gusta calcular la cantidad de YTD COGS.

Mi archivo PBI :-

https://www.dropbox.com/s/v578c2yp58eh70z/HOW%20TO%20COMPUTE%20REVENUE%20YTD%20V0002.pbix?dl=0

Paulyeo11_0-1602901139732.png

6 REPLIES 6
v-yangliu-msft
Community Support
Community Support

HolaPaulyeo11 ,

Hay dos maneras de lograr:

1. Cree una medida.

COGS_YTD_First =
CALCULATE (
    SUMX ( FILTER ( 'Table', 'Table'[PNL] = "COGS" ), 'Table'[AMOUNT] ),
    DATESYTD ( 'Date'[Date] ),
    'Table'[DATE]<=NOW(),
    'Table'[Year]=2020
)

2. Cree dos medidas.

IF =
IF(MAX('Table (2)'[PNL])="COGS",
CALCULATE(SUM('Table (2)'[AMOUNT]),FILTER('Table (2)','Table (2)'[DATE]>=CALCULATE(MIN('Table (2)'[DATE]),ALL('Table (2)'[DATE])) && 'Table (2)'[DATE]<=NOW() && 'Table (2)'[Year]=2020 )),
BLANK()
)

COGS_YTD_Second =
var _new=SUMMARIZE('Table (2)','Table (2)'[DATE],"_value",[IF])
return IF(HASONEVALUE('Table (2)'[DATE]),[IF],SUMX(_new,[_value]))
)

3. Resultado.

v-yangliu-msft_0-1603187399847.jpeg

Puede descargar el archivo PBIX desde aquí.

Saludos

Liu Yang

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

sktneer
Resolver I
Resolver I

¿Esto funciona para ti?

COGS YTD =
CALCULATE (
    SUMX ( FILTER ( 'Table', 'Table'[PNL] = "COGS" ), 'Table'[AMOUNT] ),
    DATESYTD ( 'Date'[Date] )
)
Paulyeo11
Impactful Individual
Impactful Individual

Hola Señor

Gracias por compartir su experiencia. He prueba su guión, sin error, pero incluye noviembre 2020 año. ya que YTD es sólo hasta octubre.

Paulyeo11_0-1602912112212.png

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hola Ashish

Muchas gracias por compartir su experiencia.

su guión pls helpp me exclude Dec 2019 cantidad.

Paulyeo11_0-1602913919216.png

De nada. Filtrarlo (panel Filtro)


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.