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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Aplicación de múltiples filtros a TOTALYTD

Hola a todos

Estoy tratando de aplicar dos filtros a una medida TOTALYTD que viene con el siguiente mensaje de error:

"La expresión True/False no especifica una columna. Cada expresión True/False utilizada como expresión de filtro de tabla debe hacer referencia exactamente a una columna."

El DAX que he intentado aplicar es el siguiente:

Total de pedido YTD FY á TOTALYTD(DISTINCTCOUNT('Order Details'[nOrderId]), Dates[Date],"30/06", 'Order Details'[Ventas Incluyen o Excluir] EN "Sí"))

Estaría muy agradecido de cualquier ayuda en este

1 ACCEPTED SOLUTION
ibarrau
Super User
Super User

Creo que totalytd no te permitirá agregar una condición que responda verdadero/falso. Está esperando una instrucción FILTER. Puede agregar un FILTRO a la tabla con la condición IN o probar DATESYTD dentro calcular de la siguiente manera:

CALCULATE(
	DISTINCTCOUNT('Order Details'[nOrderId])
	, DATESYTD ( Dates[Date] , "30/06" )
        , 'Order Details'[Sales Include or Exclude] = "Yes"
)

Espero que esto ayude,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
ibarrau
Super User
Super User

Creo que totalytd no te permitirá agregar una condición que responda verdadero/falso. Está esperando una instrucción FILTER. Puede agregar un FILTRO a la tabla con la condición IN o probar DATESYTD dentro calcular de la siguiente manera:

CALCULATE(
	DISTINCTCOUNT('Order Details'[nOrderId])
	, DATESYTD ( Dates[Date] , "30/06" )
        , 'Order Details'[Sales Include or Exclude] = "Yes"
)

Espero que esto ayude,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

Hola @ibarrau,

Esto funciona perfectamente gracias 😊

Anonymous
Not applicable

Hola, no conozco muy bien la función TOTALYTD(). Pero para CALCULATE uno obtiene el mismo problema. La solución es, a continuación, cambiar: 'Detalles del pedido'[Ventas IE] EN "YES" -> FILTER(ALL('Detalles del pedido'), 'Detalles del pedido'[Detalles de ventas] EN "YES")

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors