Forum Discussion
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
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)
| Invoice | Shipment | Shipment Type | Shipment Type - Main | Invoice & main | Invoice & Shipment Type | Group |
| 1891846520 | C013720583 | ZT13 | not main | 1891846520main | 1891846520not main | C012293295 |
| 1891846520 | C013720577 | ZT11 | not main | 1891846520main | 1891846520not main | C012293295 |
| 1891846520 | C013720579 | ZT13 | not main | 1891846520main | 1891846520not main | C012293295 |
| 1891846520 | C013720578 | ZT12 | main | 1891846520main | 1891846520main | C012293295 |
| 1891846523 | C013720577 | ZT11 | not main | 1891846523main | 1891846523not main | C012293295 |
| 1891846523 | C013720579 | ZT13 | not main | 1891846523main | 1891846523not main | C012293295 |
| 1891846523 | C013720586 | ZT13 | not main | 1891846523main | 1891846523not main | C012293295 |
| 1891846523 | C013720578 | ZT12 | main | 1891846523main | 1891846523main | C012293295 |
| 1891846524 | C013720579 | ZT13 | not main | 1891846524main | 1891846524not main | C012293295 |
| 1891846524 | C013720586 | ZT13 | not main | 1891846524main | 1891846524not main | C012293295 |
| 1891846524 | C013720577 | ZT11 | not main | 1891846524main | 1891846524not main | C012293295 |
| 1891846524 | C013720578 | ZT12 | main | 1891846524main | 1891846524main | C012293295 |
andhisbrother Perhaps try something like the following:
Group = MAXX( FILTER( 'Table', [Invoice] = EARLIER( [Invoice] ) && [Shipment Type - Main] = "main" ), [Shipment] )
4 Replies
- GeraldGEmerick
Memorable Member
andhisbrother Perhaps try something like the following:
Group = MAXX( FILTER( 'Table', [Invoice] = EARLIER( [Invoice] ) && [Shipment Type - Main] = "main" ), [Shipment] )- v-aatheeque
Community 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
Community 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.