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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

A table of multiple values was supplied when a single value was expected

Hi team,

 

I need some assistance, I'm getting this error message(A table of multiple values was supplied when a single value was expected) how can I fix these please. 

 

Here's the mesaure formula I created.

%Month =
DIVIDE(
SUM(NEW_Vehiclesnew[number]),
CALCULATE(
SUM(NEW_Vehiclesnew[number]),
REMOVEFILTERS(NEW_Vehiclesnew[fuel_type],NEW_Vehiclesnew[veh_type])
)
)
 Akeemadewunmi_1-1666862676131.png

 

 
Second meaure: 
Month Loading =
DIVIDE(
SUM(NEW_Vehiclesnew[Contract_RV])-SUM(NEW_Vehiclesnew[exp_sp]),sum(NEW_Vehiclesnew[number])
)
Akeemadewunmi_0-1666862630307.png

 

 
If I run the code in SQL it retruns the full table.
5 REPLIES 5
Fowmy
Super User
Super User

@Anonymous 

Please check the measure  CHARM_NEW_Vehiclesnew[Quarter Loading] or share it here.
It is causes the error due to multiple values being returned.

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi Fowny,

 

Thanks for the swift response. 

 

Quarter Loading =
CALCULATE(DIVIDE(
SUM(CHARM_NEW_Vehiclesnew[contract_rv]) - SUM(CHARM_NEW_Vehiclesnew[exp_sp]), SUM(CHARM_NEW_Vehiclesnew[aantal])),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -2, MONTH), 2, MONTH)
)
 
Anonymous
Not applicable

Month Loading =
DIVIDE(
SUM(CHARM_NEW_Vehiclesnew[Contract_RV])-SUM(CHARM_NEW_Vehiclesnew[exp_sp]),sum(CHARM_NEW_Vehiclesnew[aantal])
 
 
 
)
 
Quarter Loading =
CALCULATE(DIVIDE(
SUM(CHARM_NEW_Vehiclesnew[contract_rv]) - SUM(CHARM_NEW_Vehiclesnew[exp_sp]), SUM(CHARM_NEW_Vehiclesnew[aantal])),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -2, MONTH), 2, MONTH)
)
 
Year Loading =
CALCULATE(DIVIDE(
SUM(CHARM_NEW_Vehiclesnew[contract_rv]) - SUM(CHARM_NEW_Vehiclesnew[exp_sp]), SUM(CHARM_NEW_Vehiclesnew[aantal])),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -1, YEAR), 1, YEAR)
)
 
 

@Anonymous 

Check the highlighted line where you have DATEADD. You need to provide a single value such as MAX(CHARM_NEW_Vehiclesnew[Date]). DATEDADD returns multiple valuues that's why you net an error.

Fowmy_0-1666864928128.png


If you can explain what exactly you are trying to calculate then, I will suggest the right solution.

 




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi Fowmy,

 

Thanks once again.

 

What I am trying to calculate if by fule type on month, quater and year as in the image below. but the formula from the excel file is 

1. Issues below

Akeemadewunmi_2-1666869625509.png 

Month=AL$43/$AA$43

 

Quarter: =SUM(AL$41:AL$43)/SUM($AA$41:$AA$43)--(SUM(AL$41:AL$43) to calulate the total number of vehicles per quarter / by the total number per quarter per fuel type SUM($AA$41:$AA$43


Year: =SUM(AL$32:AL$43)/SUM($AA$32:$AA$43) ( SUM(AL$32:AL$43 to calulate the total number of vehicles per month / by the total number per fuel type SUM($AA$32:$AA$43)

 

Akeemadewunmi_0-1666869481386.pngAkeemadewunmi_1-1666869510950.png

%Month =
DIVIDE(
SUM(CHARM_NEW_Vehiclesnew[aantal]),
CALCULATE(
SUM(CHARM_NEW_Vehiclesnew[aantal]),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[fuel_type],CHARM_NEW_Vehiclesnew[veh_type])
)
)
 
%Quarter =
DIVIDE(
CALCULATE(
SUM(CHARM_NEW_Vehiclesnew[aantal]),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -2, MONTH), 2, MONTH)
),
CALCULATE(
SUM(CHARM_NEW_Vehiclesnew[aantal]),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[fuel_type],CHARM_NEW_Vehiclesnew[veh_type],CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -2, MONTH), 2, MONTH)
)
)
 
%Year =
DIVIDE(
CALCULATE(
SUM(CHARM_NEW_Vehiclesnew[aantal]),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -1, YEAR), 1, YEAR)
),
CALCULATE(
SUM(CHARM_NEW_Vehiclesnew[aantal]),
REMOVEFILTERS(CHARM_NEW_Vehiclesnew[fuel_type],CHARM_NEW_Vehiclesnew[veh_type],CHARM_NEW_Vehiclesnew[month_m]),
DATESINPERIOD(CHARM_NEW_Vehiclesnew[Date], DATEADD(CHARM_NEW_Vehiclesnew[Date], -1, YEAR), 1, YEAR)
)
)
 
Akeemadewunmi_3-1666870395254.png

 

Please let me know if the above help to solve the problem 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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