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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tomascid
Frequent Visitor

Table of multiple values was supplied where a single value was expected

tomascid_0-1678736137890.png

Hi there - referencing the example data above, I'm trying to create the 'desired output' as a dashboard visual using measures (instead of PowerQuery or calculated columns).

 

I started with this measure:

HasSPCC = LOOKUPVALUE(Plans[PlanTypeCode],Plans[FacilityId],SELECTEDVALUE(Facilities[FacilityId]))

 

Translated to English, I'm Facilities [FacilityID] within Plans [FacilityID] column and returning result Plans [PlanTypeCode].

 

I get this error: "ERROR: A table of multiple values was supplied where a single value was expected."

 

I assume it's because Plans [FacilityID] is not unique (there can be several different plans for each facility - see yellow highlights). 

 

Based on that, I assumed that wrapping the measure in a CALCULATE function would work. I tried these two, with no luck:

 

HasSPCC = CALCULATE(LOOKUPVALUE(Plans[PlanTypeCode],Plans[FacilityId],SELECTEDVALUE(Facilities[FacilityId])),Plans[PlanTypeCode] = "SPCC")

 

HasSPCC = CALCULATE(LOOKUPVALUE(Plans[PlanTypeCode],KJDatabase_Plans[FacilityId],SELECTEDVALUE(Facilities[FacilityId])),FILTER(Plans,Plans[PlanTypeCode]="SPCC"))
 
Neither worked, same issue. Any ideas?
 

 

3 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @tomascid 

create a relationship between the two tables. Use a matrix visual.. place Facilities[Facility ID] in the rows of the matrix. Place Plans[PlanTypeCode] in the columns of the matrix and place the following measure in the values of the matrix 

Count = COUNTROWS ( Plans )

View solution in original post

tomascid
Frequent Visitor

Solved! https://community.powerbi.com/t5/Desktop/LookupValue-with-Filter/td-p/993672 

Just need to use the second lookup parameters of LOOKUPVALUE:

 

Has SPCC = LOOKUPVALUE(Plans[PlanTypeCode],Plans[FacilityId],SELECTEDVALUE(Facilities[Id]),Plans[PlanTypeCode],"SPCC")

View solution in original post

v-zhangti
Community Support
Community Support

Hi, @tomascid 

 

You can try the following methods.

vzhangti_0-1679040065132.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @tomascid 

 

You can try the following methods.

vzhangti_0-1679040065132.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

tomascid
Frequent Visitor

Solved! https://community.powerbi.com/t5/Desktop/LookupValue-with-Filter/td-p/993672 

Just need to use the second lookup parameters of LOOKUPVALUE:

 

Has SPCC = LOOKUPVALUE(Plans[PlanTypeCode],Plans[FacilityId],SELECTEDVALUE(Facilities[Id]),Plans[PlanTypeCode],"SPCC")
tamerj1
Super User
Super User

Hi @tomascid 

create a relationship between the two tables. Use a matrix visual.. place Facilities[Facility ID] in the rows of the matrix. Place Plans[PlanTypeCode] in the columns of the matrix and place the following measure in the values of the matrix 

Count = COUNTROWS ( Plans )

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.