Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Syndicate_Admin
Administrator
Administrator

Search for the Sea Value serca

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

Leo3722_0-1649543953065.png

Thank you very much

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

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:

RicoZhou_1-1649752540599.png

Table2:

RicoZhou_0-1649752532777.png

Result is as below.

RicoZhou_2-1649752567607.png

 

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.

 

 

View solution in original post

1 REPLY 1
v-rzhou-msft
Community Support
Community Support

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:

RicoZhou_1-1649752540599.png

Table2:

RicoZhou_0-1649752532777.png

Result is as below.

RicoZhou_2-1649752567607.png

 

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.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.