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.
¡Hola!
Estoy intentando crear una nueva columna (DAX o PowerQuery) para que agregue el valor de la columna Cases de los últimos 14 días.
La suma debe tener en cuenta el CityCode. Por lo tanto, agregando los últimos 14 días para cada CityCode.
¿Me puedes ayudar?
Ejemplo de datos:
Fecha | Casos | CityCode | Total de casos Duran 14 días |
10/08/2020 | 3012 | 53 | 29737 |
09/08/2020 | 1233 | 53 | 26725 |
08/08/2020 | 1921 | 53 | 25492 |
07/08/2020 | 1903 | 53 | 23571 |
06/08/2020 | 2034 | 53 | 21668 |
05/08/2020 | 2042 | 53 | 19634 |
04/08/2020 | 1880 | 53 | 17592 |
03/08/2020 | 2016 | 53 | 15712 |
02/08/2020 | 2106 | 53 | 13696 |
01/08/2020 | 1630 | 53 | 11590 |
31/07/2020 | 1850 | 53 | 9960 |
30/07/2020 | 2100 | 53 | 8110 |
29/07/2020 | 1616 | 53 | 6010 |
28/07/2020 | 2246 | 53 | 4394 |
27/07/2020 | 2148 | 53 | 2148 |
10/08/2020 | 4012 | 11 | 44737 |
09/08/2020 | 2233 | 11 | 40725 |
08/08/2020 | 2921 | 11 | 38492 |
07/08/2020 | 2903 | 11 | 35571 |
06/08/2020 | 3034 | 11 | 32668 |
05/08/2020 | 3042 | 11 | 29634 |
04/08/2020 | 2880 | 11 | 26592 |
03/08/2020 | 3016 | 11 | 23712 |
02/08/2020 | 3106 | 11 | 20696 |
01/08/2020 | 2630 | 11 | 17590 |
31/07/2020 | 2850 | 11 | 14960 |
30/07/2020 | 3100 | 11 | 12110 |
29/07/2020 | 2616 | 11 | 9010 |
28/07/2020 | 3246 | 11 | 6394 |
27/07/2020 | 3148 | 11 | 3148 |
Solved! Go to Solution.
@amitchandak Hice dos ajustes y lo resolví. ¡Gracias!
Casos Ativos =
sumx(
filter(NOVO_PROTO,
NOVO_PROTO[city_ibge_code] = earlier( NOVO_PROTO[city_ibge_code] )
&& NOVO_PROTO[Data] <= earlier( NOVO_PROTO[Data] )
&& NOVO_PROTO[Data] >= earlier( NOVO_PROTO[Data] )-13),
NOVO_PROTO[Novos Confirmados])
Hola @j_martinho
¿Desea obtener los resultados de suma de [Total Cases Last 14 days] por [Citycode]? Puede probar a continuación la columna calculada:
Column = CALCULATE(SUM('Table (2)'[Total Cases Last 14 days]),FILTER(ALL('Table (2)'),[CityCode]=EARLIER('Table (2)'[CityCode])))
Si no ayuda. por favor amablemente elaborar más.
@j_martinho , Pruebe una nueva columna
sumx(filter(Table, [CityCode] á earlier( [CityCode] ) && [CityCode] <- earlier( [Date] ) && [CityCode] >- earlier( [Date] )-14),[Total Cases])
@amitchandak Hice dos ajustes y lo resolví. ¡Gracias!
Casos Ativos =
sumx(
filter(NOVO_PROTO,
NOVO_PROTO[city_ibge_code] = earlier( NOVO_PROTO[city_ibge_code] )
&& NOVO_PROTO[Data] <= earlier( NOVO_PROTO[Data] )
&& NOVO_PROTO[Data] >= earlier( NOVO_PROTO[Data] )-13),
NOVO_PROTO[Novos Confirmados])
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |