Impossible to compare dates in a select to obtain some rows

Hi all, how are you? and Merry Christmas.

 

Im trying to generate a report of sales based on dates range but until now its been impossible to me to do it.

I have a table "Pedidos" where each sale has a date with column name "[Orden_Fecha]", total amount of sale and so on, I've created another table called Total_Ventas_Acum where in the same row I have columns for the the "Fecha Inicio" of the range, the "Fecha fin" of the range, "Suma total ventas", "Ventas pagadas" and "Ventas por cobrar".

Right now I can select the range of dates but for example in the column "total sales" I have the following formula:

 

sum(SELECT(Pedidos[Total_Neto [$]],and(Pedidos[Orden_Fecha]>=[_THISROW].[Fecha Inicio],Pedidos[Orden_Fecha]>=[_THISROW].[Fecha Inicio])))

the above formula allways gives me the error

Cannot compare List with Date in (Pedidos[Orden_Fecha] >= [_THISROW].[Fecha Inicio])

I tried by enclosing the column Pedidos[Orden_Fecha] like follows

sum(SELECT(Pedidos[Total_Neto [$]],and(date(Pedidos[Orden_Fecha])>=[_THISROW].[Fecha Inicio],date(Pedidos[Orden_Fecha])<=[_THISROW].[Fecha Inicio])))

the above inmediatly gives me the error 

SELECT has invalid inputs

so I don't know what else to do to have the filtered info.

I saw the following video on youtube

https://www.youtube.com/watch?v=zxA8O4FMsYs

but it goes to another filtered view and I need to have the filtered sum.

What can I do for solving the problem?

Thanks in advance for the help.

0 7 167
7 REPLIES 7
Top Labels in this Space