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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mb0307
Responsive Resident
Responsive Resident

Error - multiple values was supplied where a single value

Hello,

 

I have this code which was working fine but when I refreshed the data it started to show this error:

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

 

OTIF Summary = 
   CALCULATETABLE(
        SUMMARIZE( 
    'OTIF Main'
    , 'OTIF Main'[PO Number]
    , 'OTIF Main'[PO Date]
    , 'OTIF Main'[Requested Qty UoM]
    , "Vendor", CALCULATE(DISTINCT('OTIF Main'[Vendor Number]))
    , "Created by", CALCULATE(DISTINCT('OTIF Main'[Created by]))
    , "Plant", CALCULATE(DISTINCT('OTIF Main'[Plant])) 
    )
   , FILTER('OTIF Main','OTIF Main'[Transaction Validity] = "Keep")
   , FILTER('OTIF Main', DATEDIFF(TODAY(), 'OTIF Main'[Requested Delivery Date], DAY) < -13 )
   )

 

Can't find why and which line is throwing error and how to correct it.  

 

You help is much appreciated.

Thanks

1 ACCEPTED SOLUTION

As you cannot use MAX or MIN function with text to force unicity for that columns, you can use FIRSTNONBLANK or LASTNONBLANK functions, only if the vendor name is not somenthing crucial in your report. Is a workaround we often use in Sql queries, when details are not important. 

You can check this post from community for reference https://community.powerbi.com/t5/Community-Blog/LASTNONBLANK-amp-FIRSTNONBLANK-How-To-Use-This-Two-D....

 

Is important to know that the values for each column will be first or last (depends on the function used) sorted in alphabetical order,

 

View solution in original post

8 REPLIES 8
MiraAciu
Regular Visitor

Hi, 

It seems that, at refresh, one of Vendor, Created by or Plant has at least 2 distinct

values for the same combination of the values for the rest of the columns. Start to investigate there. 

After that decide what you want to keep for those 3 columns and ask here for help if you need further assistance.

mb0307
Responsive Resident
Responsive Resident

@amitchandak 

Distinct is just returning the text - vendor, plant and creator names.  I don't want those to be the criteria of table summary. 

 

@MiraAciu can i just get first vendor, plant and creator name to complete the table.  I don't want these three fields to be the table summary criteria.

As you cannot use MAX or MIN function with text to force unicity for that columns, you can use FIRSTNONBLANK or LASTNONBLANK functions, only if the vendor name is not somenthing crucial in your report. Is a workaround we often use in Sql queries, when details are not important. 

You can check this post from community for reference https://community.powerbi.com/t5/Community-Blog/LASTNONBLANK-amp-FIRSTNONBLANK-How-To-Use-This-Two-D....

 

Is important to know that the values for each column will be first or last (depends on the function used) sorted in alphabetical order,

 

mb0307
Responsive Resident
Responsive Resident

@MiraAciu  Yes. FIRSTNONBLANK worked.  Thanks

 

@amitchandak  Thanks for looking into this.

@mb0307 , then it should be min/max or should be grouped? No need add like a measure.

 

 

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
amitchandak
Super User
Super User

@mb0307 , I am assuming you are creating a table. Not measure. Seems fine.

Try like

 

OTIF Summary =
SUMMARIZE( filter(
'OTIF Main' ,
'OTIF Main','OTIF Main'[Transaction Validity] = "Keep" && DATEDIFF(TODAY(), 'OTIF Main'[Requested Delivery Date], DAY) < -13 )
, 'OTIF Main'[PO Number]
, 'OTIF Main'[PO Date]
, 'OTIF Main'[Requested Qty UoM]
, "Vendor", CALCULATE(DISTINCT('OTIF Main'[Vendor Number]))
, "Created by", CALCULATE(DISTINCT('OTIF Main'[Created by]))
, "Plant", CALCULATE(DISTINCT('OTIF Main'[Plant]))
)

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

@amitchandak  Thanks. Yes I am creating a table but this is still showing the same error.  Please see below.  

 

Screenshot 2021-01-19 131445.jpg

@mb0307 , I think distinct is the issue. It should be countdistinct

 

OTIF Summary =
CALCULATETABLE(
SUMMARIZE(
'OTIF Main'
, 'OTIF Main'[PO Number]
, 'OTIF Main'[PO Date]
, 'OTIF Main'[Requested Qty UoM]
, "Vendor", CALCULATE(COUNTDISTINCT('OTIF Main'[Vendor Number]))
, "Created by", CALCULATE(COUNTDISTINCT('OTIF Main'[Created by]))
, "Plant", CALCULATE(COUNTDISTINCT('OTIF Main'[Plant]))
)
, FILTER('OTIF Main','OTIF Main'[Transaction Validity] = "Keep")
, FILTER('OTIF Main', DATEDIFF(TODAY(), 'OTIF Main'[Requested Delivery Date], DAY) < -13 )
)

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.