Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Suma acumulativa engañosa cuando se utiliza un año estático, necesita ayuda con la medida

Tengo un requisito de la empresa, que es crear una suma cummaltiva de valores basados en un año objetivo. Así que el ejercicio que estamos utilizando como objetivo base es 2019 que va de 2018/06- 2019/05. El cálculo debe tener este aspecto si dejo Mes-Año en una tabla:

Tengo un requisito de la empresa, que es crear una suma cummaltiva de valores basados en un año objetivo. Así que el ejercicio que estamos utilizando como objetivo base es 2019 que va de 2018/06- 2019/05. El cálculo debe tener este aspecto si dejo Mes-Año en una tabla:

FechaValor del mes de nueva medida Cummalative

06- 2018

10001000

07 - 2018

150

1150

08 - 2018

1251275

......

.....
07 - 2021150100,000
08 - 2021125100,125
09 - 2021.......

Mi consulta de trabajo actual tiene este aspecto:

Total de Vuelos de Emisiones 2019 Mes 2

var MinDate á CALCULATE(Min(Periods[Period_Year]),FILTER(ALLSELECTED(Periods), MIN(Periods[Period_Year]) ? Periods[Period_Year]))
var MaxDate á CALCULATE(Max(Periods[Period_Year]),FILTER(ALLSELECTED(Periods), Max(Periods[Period_Year]) ? Periods[Period_Year]))
var Calc á CALCULATE(SUM('Tandem Flights'[Emissions no RF (tCO2e)]),FILTER(ALL( Periods ), Periods[Period_Year] á 2019))
var Maxcalc á CALCULATE(SUM('Tandem Flights'[Emissions no RF (tCO2e)]),FILTER(ALL ( Periods ), Periods[Period_monthno] <- MAX (Períodos[Period_monthno]) && Periods[Period_Year] a 2019))

devolución

Calc * (MaxDate - 2019) + Maxcalc
Sólo funciona si se realiza un seguimiento justo en el inicio del año 2019. Me preguntaba si es posible simplificar esta consulta, por lo que todo lo que tengo que hacer es ejecutar un cálculo que utiliza el mes de filas e intercambia el período de filas Año con 2019 con el fin de obtener la cantidad correcta utilizando el mes relativo?
3 REPLIES 3
amitchandak
Super User
Super User

@Dl_BL_PB , Trate como este ejemplo

Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <-maxx(date,date[date]) && date[Year] á 2019))

O

Ventas de Cumm: CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <-maxx(date,date[date]) && year(date[Date]) - 2019))

Anonymous
Not applicable

Hi None of those measures worked. Thanks for trying. 

 

It is a little bit complicated but basically i am trying to have a calculation that uses 2019 as a base year.

 

So if 

2019 - Jan = 100

2019 - Feb = 50

2019 - March = 20

2019 - April = 30

2019 - May = 40

2019 - June = 30

2019 - July = 110

....

2021 - Jan = 100

2021 - Feb = 50

2021 - March = 20

2021 - April = 30

 

So If i am in 2021 Jan, i use 2019 Jan data. In the date table i have a Year-Month column. This calculation would allow me to calculate a cummalative count over any period of time.

 

My current calculation works but only when comparing a full year, it does not work when comparing multiple years together as a cummalative count:
CALCULATE(SUM('Tandem Flights'[Emissions no RF (tCO2e)]),FILTER(ALL ( Periods ), Periods[Period_monthno] <= MAX (Periods[Period_monthno]) && Periods[Period_Year] = 2019))
 
What it looks like between dates:, the problem is that it resets every year.
perioddateemissions.png


Hola @Dl_BL_PB,

¿Puede compartir algunos datos ficticios con una estructura de datos similar, entonces podemos probar la fórmula de codificación en ella?

Cómo obtener respuestas a su pregunta rápidamente
saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors