Forum Discussion
Error - multiple values was supplied where a single value
- 5 years ago
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-DAX-Function/ba-p/1403721#:~:text=These%20two%20functions%20are%20pretty,FIRSTNONBLANK%20returns%20the%20first%20value.
Is important to know that the values for each column will be first or last (depends on the function used) sorted in alphabetical order,
amitchandak Thanks. Yes I am creating a table but this is still showing the same error. Please see below.
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 )
)