Hello!
I've this table:
https://dl.dropboxusercontent.com/u/9510624/Cattura.PNG
What i need to do is match the right CommInt with the date of the ticket.
For example, the ticket date is 15/07/2015 so the commission used will be the one of the issuing company for that specific period (i cannot use years since some companies have non-standard commission periods).
DataInizioComm means Starting Day, while DataFineComm means Ending Day.
As for now i tried to do:
With no luck
I humbly beg for help at this point!
I've this table:
https://dl.dropboxusercontent.com/u/9510624/Cattura.PNG
What i need to do is match the right CommInt with the date of the ticket.
For example, the ticket date is 15/07/2015 so the commission used will be the one of the issuing company for that specific period (i cannot use years since some companies have non-standard commission periods).
DataInizioComm means Starting Day, while DataFineComm means Ending Day.
As for now i tried to do:
Code:
=IF([TipoTratta]="I";
CALCULATE(
LOOKUPVALUE(VistaCommissioni[CommInt];VistaCommissioni[CodiceCompagnia];
Vantravel[CodiceCompagnia]);VistaCommissioni[CodiceCompagnia]=Vantravel[CodiceCompagnia];
FILTER(VALUES(Vantravel[DataEmissione]);VistaCommissioni[DataInizioComm]<=Vantravel[DataEmissione] && VistaCommissioni[DataFineComm] >= Vantravel[DataEmissione]));
CALCULATE(
LOOKUPVALUE(VistaCommissioni[CommNaz];VistaCommissioni[CodiceCompagnia];
Vantravel[CodiceCompagnia]);VistaCommissioni[CodiceCompagnia]=Vantravel[CodiceCompagnia];
FILTER(VALUES(Vantravel[DataEmissione]);VistaCommissioni[DataInizioComm]<=Vantravel[DataEmissione] && VistaCommissioni[DataFineComm] >= Vantravel[DataEmissione]))
)
With no luck
I humbly beg for help at this point!