Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Good afternoon.
I have two tables in one the daily sales in pesos and in another the tc, I need to put the tc in the sale, the problem is that not all the quote dates are and I need to search for the next value to complete all the cells in the sale table
Thank you very much
Solved! Go to Solution.
Hi @Syndicate_Admin ,
According to your statement, I think you want to get TC from the nearest [Fecha cotizacion].
Try this code.
TC =
VAR _NEARST_DATE =
MAXX (
FILTER ( Table2, Table2[Fecha cotizacion] <= EARLIER ( Table1[Fecha Origen] ) ),
Table2[Fecha cotizacion]
)
RETURN
CALCULATE (
SUM ( Table2[Venta] ),
FILTER ( Table2, Table2[Fecha cotizacion] = _NEARST_DATE )
)
My Sample is as below.
Table1:
Table2:
Result is as below.
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.
Hi @Syndicate_Admin ,
According to your statement, I think you want to get TC from the nearest [Fecha cotizacion].
Try this code.
TC =
VAR _NEARST_DATE =
MAXX (
FILTER ( Table2, Table2[Fecha cotizacion] <= EARLIER ( Table1[Fecha Origen] ) ),
Table2[Fecha cotizacion]
)
RETURN
CALCULATE (
SUM ( Table2[Venta] ),
FILTER ( Table2, Table2[Fecha cotizacion] = _NEARST_DATE )
)
My Sample is as below.
Table1:
Table2:
Result is as below.
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.
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |