Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hola - Estoy usando la medida QTD a continuación y funciona bien.
Sin embargo, la medida YTD solo devuelve un valor en blanco. Sé que hay varias maneras de calcular YTD, pero estoy tratando de estandarizar mis fórmulas y me gusta esta fórmula porque oculta fechas futuras sin valores. Cualquier idea de por qué el YTD está regresando en blanco... y cómo arreglarlo, pero manteniendo esta estructura de fórmula general.
Solved! Go to Solution.
Puede utilizar las dos medidas siguientes:
YTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
QTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE ( YEAR (TODAY()), ROUNDUP(DIVIDE(MONTH(TODAY()),3 ),0 ) *3 -2, 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los demás miembros a encontrarla más rápidamente.
Saludos
Dedmon Dai
Puede utilizar las dos medidas siguientes:
YTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
QTD Orders = CALCULATE(SUM('Orders 2'[Net Price]), FILTER('Date Table', 'Date Table'[Date] >= DATE ( YEAR (TODAY()), ROUNDUP(DIVIDE(MONTH(TODAY()),3 ),0 ) *3 -2, 1)), FILTER('Date Table', 'Date Table'[Date] <= TODAY()))
Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los demás miembros a encontrarla más rápidamente.
Saludos
Dedmon Dai
@stevedep Gracias Steve. Lo intenté y por alguna razón todavía vuelve en blanco. Pero veo que en el editor de DAX lo tienes para trabajar para ti. No estoy seguro de por qué no está en mi conjunto de datos. Por supuesto, puedo usar una suma de medida total que funciona muy bien. Pero mi intención original era tratar de mantenerme con la misma estructura de fórmula que estoy usando en las medidas mtd y QTD como hice referencia anteriormente. Pensé que al reemplazar "Quarter" por "Year" funcionaría, pero no lo hace.
@texmexdragon , Trate de utilizar la inteligencia del tiempo
Ventas de QTD = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Ventas YTD = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
YTD QTY forzado=
var _max = hoy()
devolución
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESYTD('Date'[Date])), blank())
O
calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.