Forum Discussion
Abevann
Helper III
5 years agoFilter based in a table results
Guys, I have a requirement. I have a DB with salespersons that have been taking care of several customers. Each customer has been buying for some years and sometimes they change the salesperson. They...
Abevann
Helper III
5 years agoHi Rico
I have an issue with one value, and wondering why; it doesn't accept alphanumeric values, only numbers in OINV[CardName] (in bold):
M.Sales =
VAR _CustomerTable =
SUMMARIZE (
FILTER ( ALL ( 'OINV' ), OINV[SlpCode]= [M.Salesperson] ),
OINV[CardName]
)
VAR _Sales =
SUMX (
FILTER (
'Fecha',
Fecha[Año] = MAX ( Fecha[Año] )
&& OINV[CardName] IN _CustomerTable
),
OINV[Ventas menos notas de crédito]
)
VAR _Total =
SUMX ( FILTER ( 'OINV', OINV[CardName] IN _CustomerTable ), OINV[Ventas menos notas de crédito] )
RETURN
IF ( HASONEVALUE ( Fecha[Año] ), _Sales, _Total )
Thanks Rico,
Abevann
Anonymous
5 years agoNot applicable
Hi Abevann
It seems that you have a Dimdate table (Fecha). You can try to use the date column in OINV table in _Sales.
Did you related two tables by dates?
Please show me a sample like what you are dealing with.
This may make it easier for me to understand your data model.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.