Forum Discussion

andhisbrother's avatar
andhisbrother
Regular Visitor
10 months ago
Solved

One table Vlookup equivalent in DAX

Dear community,

 

I'm trying to get shipment C013720578 to be shown in column Group for all rows. Shipment C013720578 is the main shipment, out of 4 shipments linked to invoice 1891846520. I need to do this for all Invoices in column Invoice.

 

My first try was lookupvalue

Column = LOOKUPVALUE('BRIDGE FULL'[Shipment],'BRIDGE FULL'[Invoice & main],'BRIDGE FULL'[Invoice & Shipment Type])
 

This wouldn't work becuase there are duplicates (in the Search Value I think), and I got this error:

A table of multiple values was supplied where a single value was expected.

 

How do I modify the formula below please? or something completely different?

(hint: shipment C012293295 currently shown in column Group is the very first shipment of the entire big table)

 

InvoiceShipmentShipment TypeShipment Type - MainInvoice & mainInvoice & Shipment TypeGroup
1891846520C013720583ZT13not main1891846520main1891846520not mainC012293295
1891846520C013720577ZT11not main1891846520main1891846520not mainC012293295
1891846520C013720579ZT13not main1891846520main1891846520not mainC012293295
1891846520C013720578ZT12main1891846520main1891846520mainC012293295
1891846523C013720577ZT11not main1891846523main1891846523not mainC012293295
1891846523C013720579ZT13not main1891846523main1891846523not mainC012293295
1891846523C013720586ZT13not main1891846523main1891846523not mainC012293295
1891846523C013720578ZT12main1891846523main1891846523mainC012293295
1891846524C013720579ZT13not main1891846524main1891846524not mainC012293295
1891846524C013720586ZT13not main1891846524main1891846524not mainC012293295
1891846524C013720577ZT11not main1891846524main1891846524not mainC012293295
1891846524C013720578ZT12main1891846524main1891846524mainC012293295

 

 

  • andhisbrother Perhaps try something like the following:

    Group = MAXX( FILTER( 'Table', [Invoice] = EARLIER( [Invoice] ) && [Shipment Type - Main] = "main" ), [Shipment] )

4 Replies

  • andhisbrother Perhaps try something like the following:

    Group = MAXX( FILTER( 'Table', [Invoice] = EARLIER( [Invoice] ) && [Shipment Type - Main] = "main" ), [Shipment] )
    • v-aatheeque's avatar
      v-aatheeque
      Icon for Community Support rankCommunity Support

      Hi andhisbrother 

      We wanted to follow up to check if you’ve had an opportunity to review the previous responses. If you require further assistance, please don’t hesitate to let us know.

       

       

      • v-aatheeque's avatar
        v-aatheeque
        Icon for Community Support rankCommunity Support

        Hi andhisbrother 

        Have you had a chance to look through the responses shared earlier? If anything is still unclear, we’ll be happy to provide additional support.