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

Error de filtro de fecha All(): "Se proporcionó una tabla de varios valores donde se esperaba un único valor"

Hola

Tengo una medida muy simple en la que me he quedado atascado.

Quiero sumar la cantidad $ de una tabla basada en 3 condiciones + eliminar la segmentación de fecha en la página del informe.

Relación es la tabla de fechas está vinculada a una tabla de datos PnL por fecha. La tabla Date tiene una segmentación de datos.

Esta es mi medida:

CALCULATE(SUM(PnL[$]),

FILTER(PnL,PnL[Type]-"Asset" && PnL[Class] <> "Overhead" && PnL[Sold?] - "False" -- Estas son las 3 condiciones para las que estoy filtrando
&& ALL(PnL[Date]))) -- Quiero eliminar el filtro de la segmentación de tabla de fechas
He probado cada combinación y ubicación que se me ocurre utilizar las funciones ALL(), REMOVEFILTERS(), y FILTER(ALL()), pero el único resultado que obtengo es que no elimina el filtro de fecha o obtengo una "Una tabla de múltiples valores se proporcionó donde se esperaba un solo valor." (que es lo que ocurre en el ejemplo anterior)
Creo que es algo obvio que me estoy perdiendo pero no puedo decir qué.
Gracias por tu ayuda
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks Pragati11.

I did try a modification of this function with mixed results.  When using Filter(ALL(Date), then the only field that can be filtered is date.

 

Here's what I did, however some of my detail views didn't submit up everything properly at the detail level.

 

CALCULATE (SUM (PnL [$]),

FILTER (ALL (PnL [Date]),1=1), PnL [Type] = "Asset" && PnL [Class] <> "Overhead" && PnL [Sold?] = "False")
 
What I ended up doing is in m query created a copy of the data set and grouped the data and removed the dates from that grouped table.  This eliminated the problem but it seems like I should have been able to have solved this within DAX.
 
Thanks for your help

View solution in original post

5 REPLIES 5
Pragati11
Super User
Super User

No @luketerry,

Le sugeriré escribir su dax de la siguiente manera:

CALCULATE(SUM(PnL[$]),

FILTER(ALL(PnL[Date]),PnL[Type]-"Asset" && PnL[Class] <> "Overhead" && PnL[Sold?] á "False"))

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Thanks Pragati11.

I did try a modification of this function with mixed results.  When using Filter(ALL(Date), then the only field that can be filtered is date.

 

Here's what I did, however some of my detail views didn't submit up everything properly at the detail level.

 

CALCULATE (SUM (PnL [$]),

FILTER (ALL (PnL [Date]),1=1), PnL [Type] = "Asset" && PnL [Class] <> "Overhead" && PnL [Sold?] = "False")
 
What I ended up doing is in m query created a copy of the data set and grouped the data and removed the dates from that grouped table.  This eliminated the problem but it seems like I should have been able to have solved this within DAX.
 
Thanks for your help
AlB
Super User
Super User

No @luketerry

Tratar

CALCULATE (
    SUM ( PnL[$] ),
    FILTER (
        PnL,
        PnL[Type] = "Asset" && PnL[Class] <> "Overhead" && PnL[Sold?] = "False"
    ),
    ALL ( PnL[Date] )
)

Por favor, marque la pregunta resuelta cuando haya terminado y considere dar un pulgar hacia arriba si las publicaciones son útiles.

Póngase en contacto conmigo de forma privada para obtener asistencia con cualquier necesidad de BI a gran escala, tutoría, etc.

Salud

SU18_powerbi_badge

Anonymous
Not applicable

Gracias A. B

Desafortunadamente esto tampoco funciona. Incluso simplifiqué la estructura eliminando la 'tabla de fechas' y cambié la segmentación de fecha de la 'tabla de fechas' al campo de fecha en los datos PnL.

Este es el resultado que obtengo cuando tengo ALL(PnL[Date])) - todavía filtra para ser sólo 12/1/2020 datos

luketerry_0-1609777328959.png

Pragati11
Super User
Super User

No @luketerry,

¿Puede compartir amablemente la sintaxis exacta de su medida por favor; con el fin de entender el error exacto.?

Actualmente no puedo entenderlo completamente ya que lo has dividido en dos.

Además, intente compartir algunos datos de ejemplo.

Gracias

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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