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 tratando de calcular una suma corriente que se restablece al final de cada año (31 de diciembre) y se refleja correctamente al perforar a través de trimestres y meses. Digamos que tengo Tabla1 con dos columnas:
- Fecha
- Ingresos
Hasta ahora he intentado:
TRIAL1 = CALCULATE(SUM(Table1[Revenue]), FILTER(ALL(Table1), ISONORAFTER(Table1[Date], MAX(Table1[Date]), DESC)))
Esto refleja la investigación con precisión, pero no se restablece a partir de 0 en enero 1 de un nuevo año. En su lugar, sigue agregando.
Por lo tanto, he intentado lo siguiente, que restablece correctamente la suma cada año, pero cuando, la perforación hacia abajo, muestra el valor para el trimestre específico (o mes o día) sin agregar con precisión.
TRIAL2 = CALCULATE(SUM(Table1[Revenue]), DATESYTD(Table[Date]))
He intentado combinar los dos, pero sin mucho éxito, ¿sugerencias? ¡Gracias!
Solved! Go to Solution.
Hola @zctqslo ,
Intente crear una medida como esta:
RunningTotal = CALCULATE(
SUM( table1[revenue] ),
FILTER( ALL(Table1) ,
SUMX( FILTER( Table1, EARLIER( Table1[date] ) <= Table1[date] &&YEAR(table1[date])=YEAR(EARLIER(table1[date]))), table1[revenue] )
)
)
Saludos
Liang
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @zctqslo ,
Intente crear una medida como esta:
RunningTotal = CALCULATE(
SUM( table1[revenue] ),
FILTER( ALL(Table1) ,
SUMX( FILTER( Table1, EARLIER( Table1[date] ) <= Table1[date] &&YEAR(table1[date])=YEAR(EARLIER(table1[date]))), table1[revenue] )
)
)
Saludos
Liang
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@zctqslo , Puede tener lo siguiente para YTD. Pero necesitas usar Calendar
YTD QTY = TOTALYTD(Sum('order'[Qty]),'Date'[Date])
LYTD QTY = TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year))
Previous Year = CALCULATE(SUM('order'[Qty]), PREVIOUSYEAR('Date'[Date]))
YTD QTY forced=
var _max = today()
return
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]<=_max)
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
LYTD QTY forced=
var _max = date(year(today())-1,month(today()),day(today()))
return
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
YTD QTY forced=
var _max = maxx('order',[Order date])
return
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),'Date'[Date]<=_max)
//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
LYTD QTY forced=
var _max1 =maxx('order',[Order date])
var _max = date(year(_max1)-1,month(_max1),day(_max1))
return
CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
Para obtener lo mejor de la función de inteligencia de tiempo. Asegúrese de que tiene un calendario de fechas y se ha marcado como la fecha en la vista de modelo. Además, únase a él con la columna de fecha de su hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...
Aprecia tus Felicitaciones.
Vea si mi Inteligencia del Tiempo el Camino Duro proporciona una manera diferente de lograr lo que usted está buscando.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...
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 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |