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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
gorikovsk21
Frequent Visitor

LOOKUPVALUE with multiple matches

I have two tables in Power BI

 

1° Table: products and sales date 

 

Captura de Tela (112).png 

 

2° Table: products ocurrency transactions date

 

Captura de Tela (111).png

 

I would like to input the Sale_Date of 2° table in each correspondet collumn of 1° table. If there's no sale, insert blank().

 

I tried do this using LOOKUPVALUE but I didn't succeed

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @gorikovsk21 ,

Please refer to the following steps to see if it helps you.

Create a column.

RANK = 
VAR rank_ =
    RANKX (
        FILTER ( Sales_2, Sales_2[ID_Product] = EARLIER ( Sales_2[ID_Product] ) ),
        Sales_2[sales_date],
        ,
        ASC,
        DENSE
    )
RETURN
    rank_ & " Sales_Date"

 

vpollymsft_0-1643100847443.png

Best Regards

Community Support Team _ Polly

 

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

5 REPLIES 5
Anonymous
Not applicable

Hi @gorikovsk21 ,

Please refer to the following steps to see if it helps you.

Create a column.

RANK = 
VAR rank_ =
    RANKX (
        FILTER ( Sales_2, Sales_2[ID_Product] = EARLIER ( Sales_2[ID_Product] ) ),
        Sales_2[sales_date],
        ,
        ASC,
        DENSE
    )
RETURN
    rank_ & " Sales_Date"

 

vpollymsft_0-1643100847443.png

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Hey buddy, how about if I wanted the second value for instance?
Is there any way to return the Nst value?

Sem título.png

gorikovsk21
Frequent Visitor

I would like to do like this picture:

 

WhatsApp Image 2022-01-21 at 11.59.25.jpeg

 

I need to know sale date of each product, but grouped by collumns for each sale date : 1° sale date, 2° sale date and 3° sale date.

 

Thank you for your reply!

ValtteriN
Super User
Super User

Hi,

I need some further information to tackle this. What is your end goal with the data? It is possible to return e.g. latest, second latest and third latest dates into a column, but I wouldn't necessarily recommend this. Also do you want fill all the 1, 2, 3 columns or just [3 date]?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I would like to do like this picture:

 

WhatsApp Image 2022-01-21 at 11.59.25.jpeg

 

I need to know sale date of each product, but grouped by collumns for each sale date : 1° sale date, 2° sale date and 3° sale date.

 

Thank you for your reply!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.