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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

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

i'm using the formula:

scopef2 = LOOKUPVALUE (
'Table'[code],
'Table'[Project Name], actuals[Project Name])

But error is :A table of multiple values was supplied where a single value was expected

 

then i used

scopecode = CALCULATE (
FIRSTNONBLANK ( 'Table'[code], 1 ),
FILTER ( ALL ( 'Table' ), 'Table'[Project Name] =actuals[Project Name] )
)

 

but this is giving wrong output like

 

projectname  scopecode

att                  FN

zte                  Fn

 

it is giving only fn values for all projects but there are multiple values in column "code" which are not displayed

output should be:

 

projectname  scopecode

att                  FN

att                  TP

att                  GS

zte                 FN

zte                  TP

zte                  GS

             

Let me know what is wrong im doing

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

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Actuals:

b1.png

 

Table:

b2.png

 

You may create a measure or a calculated column as below.

Measure:

Measure = 
CONCATENATEX(
    FILTER(
        ALL('Table'),
        'Table'[Project Name]=SELECTEDVALUE('Actuals'[Project Name])
    ),
    [Code],
    ","
)

 

Calculated column:

Column = 
CONCATENATEX(
    FILTER(
        ALL('Table'),
        'Table'[Project Name]=EARLIER('Actuals'[Project Name])
    ),
    [Code],
    ","
)

 

Result:

b3.png

Best Regards

Allan

 

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

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Actuals:

b1.png

 

Table:

b2.png

 

You may create a measure or a calculated column as below.

Measure:

Measure = 
CONCATENATEX(
    FILTER(
        ALL('Table'),
        'Table'[Project Name]=SELECTEDVALUE('Actuals'[Project Name])
    ),
    [Code],
    ","
)

 

Calculated column:

Column = 
CONCATENATEX(
    FILTER(
        ALL('Table'),
        'Table'[Project Name]=EARLIER('Actuals'[Project Name])
    ),
    [Code],
    ","
)

 

Result:

b3.png

Best Regards

Allan

 

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

 

Greg_Deckler
Community Champion
Community Champion

@Anonymous - If this is a measure:

scopef2 = LOOKUPVALUE ('Table'[code],'Table'[Project Name], actuals[Project Name])

Then it would probably need to be something like this:

scopef2 = LOOKUPVALUE('Table'[code],'Table'[Project Name],MAX(actuals[Project Name]))

The reason is that references to columns generally need an aggregator around them. Now, the first two parameters of LOOKUPVALUE do not because these are simply informational to the function, where to look, what to bring back. The third however is the value you are looking up. Thus, you need to wrap it in an aggregation.

 

Now, the other potential problem that you might have is that you didn't specify an alternate result in the event that multiple rows are found. You can fix this like:

scopef2 = LOOKUPVALUE('Table'[code],'Table'[Project Name],MAX(actuals[Project Name]),"Alternate")

Alternatively, you can avoid that possibility by doing this:

scopef2 = CONCATENATEX(FILTER('Table'[Project Name]=MAX(actuals[Project Name])),[code],",")

In any event, sample source data would be tremendously helpful in this circumstance to be very specific about how to fix this properly.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Anonymous - Did this solve your issue?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , Try as new columns

maxx(FILTER ( ( 'Table' ), 'Table'[Project Name] =actuals[Project Name] ),'Table'[code])

or
minx(FILTER ( ( 'Table' ), 'Table'[Project Name] =actuals[Project Name] ),'Table'[code])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak ,

maxx or minx are displaying single values only.

@Anonymous - MAXX and MINX will always display single values. Use the alternate result parameter of LOOKUPVALUE to determine if you are getting multiple values back. Or, replace MAXX and/or MINX with COUNTROWS.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors