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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Saxon10
Post Prodigy
Post Prodigy

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

Hi,
I have two tables: 'data' and 'report'. The 'data' table comprises columns such as State, City, Mode, Ship-To, Phone, and Location. Meanwhile, the 'report' table contains columns including Item, State, City, Mode, and Ship-To.

The relationship between these tables is established through shared attributes—City, Mode, and Ship-To. 
I aim to retrieve the Phone and Location information from the 'data' table based on matches found in the 'City', 'Mode', and 'Ship-To' columns from the 'report' table.
I attempted to utilize the lookupvalue function but encountered an error message. "A table of multiple values was supplied where a single value was expected."

PHONE(DESIRED RESULT-I) = LOOKUPVALUE(DATA[PHONE],DATA[CITY],REPORT[CITY],DATA[MODE],REPORT[MODE],DATA[SHIP TO],REPORT[SHIP TO])

 

LOCATION(DESIRED RESULT-I) = LOOKUPVALUE(DATA[LOCATION],DATA[CITY],REPORT[CITY],DATA[MODE],REPORT[MODE],DATA[SHIP TO],REPORT[SHIP TO])
I am seeking a DAX formula to generate the desired outcome by creating a new calculated column.

 

Report Table:

Saxon10_1-1698970404645.png


Report Table:

ITEMCITYMODESHIP TOPHONE(DESIRED RESULT)LOCATION(DESIRED RESULT)
12C1AIRA010-C050A01A010
13C1AIRA010-C050A01A010
14C1AIRA010-C050A01A010
15C1AIRA010-C050A01A020
16C1AIRA010-C050A01A020
17C1AIRA010-C050A01A020
18C1AIRA010-C050A01A030
19C1AIRA010-C050A01A030
20C1AIRA010-C050A01A030
21C1AIRA010-C050A01A040
22C1AIRA010-C050A01A040
23C1AIRA010-C050A01A040
24C1AIRA010-C050A01A050
25C1AIRA010-C050A01A050
26C1AIRA010-C050A01A050
27C2AIRA060-C100A01A060
28C2AIRA060-C100A01A060
29C2AIRA060-C100A01A060
30C2AIRA060-C100A01A070
31C2AIRA060-C100A01A070
32C2AIRA060-C100A01A070
33C2AIRA060-C100A01A080
34C2AIRA060-C100A01A080
35C2AIRA060-C100A01A080
36C2AIRA060-C100A01A090
37C2AIRA060-C100A01A090
38C2AIRA060-C100A01A090
39C2AIRA060-C100A01A100
40C2AIRA060-C100A01A100
41C2AIRA060-C100A01A100
42C1TRAINT010-C050T01T010
43C1TRAINT010-C050T01T010
44C1TRAINT010-C050T01T010
45C1TRAINT010-C050T01T020
46C1TRAINT010-C050T01T020
47C1TRAINT010-C050T01T020
48C1TRAINT010-C050T01T030
49C1TRAINT010-C050T01T030
50C1TRAINT010-C050T01T030
51C1TRAINT010-C050T01T040
52C1TRAINT010-C050T01T040
53C1TRAINT010-C050T01T040
54C1TRAINT010-C050T01T050
55C1TRAINT010-C050T01T050
56C1TRAINT010-C050T01T050
57C2TRAINT060-C100T01T060
58C2TRAINT060-C100T01T060
59C2TRAINT060-C100T01T060
60C2TRAINT060-C100T01T070
61C2TRAINT060-C100T01T070
62C2TRAINT060-C100T01T070
63C2TRAINT060-C100T01T080
64C2TRAINT060-C100T01T080
65C2TRAINT060-C100T01T080
66C2TRAINT060-C100T01T090
67C2TRAINT060-C100T01T090
68C2TRAINT060-C100T01T090
69C2TRAINT060-C100T01T100
70C2TRAINT060-C100T01T100
71C2TRAINT060-C100T01T100

 

Data Table:

Saxon10_0-1698970267052.png

 


Data Table:

STATECITYMODESHIP TOPHONELOCATION
C010C1TRAINT010-C050A01T010
C020C1AIRA010-C050A01A020
C030C1AIRA010-C050A01A030
C040C1AIRA010-C050A01A040
C050C1AIRA010-C050A01A050
C060C2AIRA060-C100A01A060
C070C2AIRA060-C100A01A070
C080C2AIRA060-C100A01A080
C090C2AIRA060-C100A01A090
C100C2AIRA060-C100A01A100
C010C1AIRA010-C050A01A010
C060C2TRAINT060-C100T01T060
C030C1TRAINT010-C050T01T030
C040C1TRAINT010-C050T01T040
C050C1TRAINT010-C050T01T050
C020C1TRAINT010-C050T01T020
C070C2TRAINT060-C100T01T070
C080C2TRAINT060-C100T01T080
C090C2TRAINT060-C100T01T090
C100C2TRAINT060-C100T01T100


https://www.dropbox.com/scl/fi/ow27nnsst5pjh5566bxad/ZBS-LOOKUP-MULTIPLE-VALUE-SUPPLY-02.11.23.pbix?...

3 REPLIES 3
ryan_mayu
Super User
Super User

why the first line location is also A010 ? what's the logic of matching?





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

Proud to be a Super User!




@ryan_mayu , Thanks for yor reply. The logic is It's a combination of the columns City, Mode, and Ship-To from both tables.

let's make it be clearer

 

for the same city,mode and shipto which I highlighted. We can find A010,A020,A030,A040,A050.

 

why you set A010 for item 12-14 and A020 for item 15-17? Each location is set for 3 times? what if we have more than 3? How to allocate these locations?

11.PNG





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

Proud to be a Super User!




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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric Community.