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
ddeutschman
Helper I
Helper I

Create a measure with value from another table

I need to create a measure which is the % of a sales goal for a salesperson.  The total sales for a person is a Measure in a transaction table - TotalTYDSales.  The sales goal, YTDPlan,  is in a separate table with no direct relationship with the transaction table.  The relationship is through the customer table.  I created a Measure in the transaction table called TotalYTDSales.  When I attempt to create a measue of PctYTDSales using the formula trantable[TotalYTDSales] / Plantable[YTDPlan], I get an error:  "A single value for a column 'YTDPlan in table 'PlanTable' cannot be determined.  This can happen when a measure formula refers to a column that contains many values without specifying an aggregation...."

 

How can I create this Measure?

1 ACCEPTED SOLUTION

That worked.  Thank You!

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @ddeutschman,

 

Can you share some sample data to test?

 

Regards,

Xiaoxin Sheng

There is confidential information in the tables.  Is there some other method of troubleshooting the issue?

Anonymous
Not applicable

Hi @ddeutschman,

 

You can share the table structure and the measure formula, I will build some sample data to test.

 

Regards,

XIaoxin Sheng

Here are the schemas for the two tables in question:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ud_Service_Sales                       
                        
COLUMN_NAMETABLE_CATALOGTABLE_SCHEMATABLE_NAMECOLUMN_NAMEORDINAL_POSITIONCOLUMN_DEFAULTIS_NULLABLEDATA_TYPECHARACTER_MAXIMUM_LENGTHCHARACTER_OCTET_LENGTHNUMERIC_PRECISIONNUMERIC_PRECISION_RADIXNUMERIC_SCALEDATETIME_PRECISIONCHARACTER_SET_CATALOGCHARACTER_SET_SCHEMACHARACTER_SET_NAMECOLLATION_CATALOGCOLLATION_SCHEMACOLLATION_NAMEDOMAIN_CATALOGDOMAIN_SCHEMADOMAIN_NAME
ARCoViewpointdboudService_SalesARCo1NULLNOtinyintNULLNULL3100NULLNULLNULLNULLNULLNULLNULLViewpointdbobCompany
ContractViewpointdboudService_SalesContract2NULLYESvarchar1010NULLNULLNULLNULLNULLNULLiso_1NULLNULLLatin1_General_BINViewpointdbobContract
MthViewpointdboudService_SalesMth3NULLNOsmalldatetimeNULLNULLNULLNULLNULL0NULLNULLNULLNULLNULLNULLViewpointdbobMonth
TranDateViewpointdboudService_SalesTranDate4NULLNOsmalldatetimeNULLNULLNULLNULLNULL0NULLNULLNULLNULLNULLNULLViewpointdbobDate
InvoicedViewpointdboudService_SalesInvoiced5NULLNOnumericNULLNULL12102NULLNULLNULLNULLNULLNULLNULLViewpointdbobDollar
udSALESMANViewpointdboudService_SalesudSALESMAN6NULLYESintNULLNULL10100NULLNULLNULLNULLNULLNULLNULLViewpointdbobEmployee
DepartmentViewpointdboudService_SalesDepartment7NULLNOvarchar1010NULLNULLNULLNULLNULLNULLiso_1NULLNULLLatin1_General_BINViewpointdbobDept
                        
vbudServiceSalesPlan                       
                        
COLUMN_NAMETABLE_CATALOGTABLE_SCHEMATABLE_NAMECOLUMN_NAMEORDINAL_POSITIONCOLUMN_DEFAULTIS_NULLABLEDATA_TYPECHARACTER_MAXIMUM_LENGTHCHARACTER_OCTET_LENGTHNUMERIC_PRECISIONNUMERIC_PRECISION_RADIXNUMERIC_SCALEDATETIME_PRECISIONCHARACTER_SET_CATALOGCHARACTER_SET_SCHEMACHARACTER_SET_NAMECOLLATION_CATALOGCOLLATION_SCHEMACOLLATION_NAMEDOMAIN_CATALOGDOMAIN_SCHEMADOMAIN_NAME
CoViewpointdbovbudServiceSalesPlanCo1NULLNOtinyintNULLNULL3100NULLNULLNULLNULLNULLNULLNULLViewpointdbobCompany
CompanyViewpointdbovbudServiceSalesPlanCompany2NULLYEStinyintNULLNULL3100NULLNULLNULLNULLNULLNULLNULLViewpointdbobCompany
EmployeeViewpointdbovbudServiceSalesPlanEmployee3NULLYESintNULLNULL10100NULLNULLNULLNULLNULLNULLNULLViewpointdbobEmployee
Plan_Annual_MarginViewpointdbovbudServiceSalesPlanPlan_Annual_Margin4NULLYESnumericNULLNULL9102NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
Plan_Annual_SalesViewpointdbovbudServiceSalesPlanPlan_Annual_Sales5NULLYESnumericNULLNULL9102NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
Plan_Monthly_MarginViewpointdbovbudServiceSalesPlanPlan_Monthly_Margin6NULLYESnumericNULLNULL9102NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
Plan_Monthly_SalesViewpointdbovbudServiceSalesPlanPlan_Monthly_Sales7NULLYESnumericNULLNULL9102NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
Rec_KeyViewpointdbovbudServiceSalesPlanRec_Key8NULLNOintNULLNULL10100NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
Start_MonthViewpointdbovbudServiceSalesPlanStart_Month9NULLYEStinyintNULLNULL3100NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
YearViewpointdbovbudServiceSalesPlanYear10NULLYESsmallintNULLNULL5100NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
UniqueAttchIDViewpointdbovbudServiceSalesPlanUniqueAttchID11NULLYESuniqueidentifierNULLNULLNULLNULLNULLNULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
KeyIDViewpointdbovbudServiceSalesPlanKeyID12NULLNObigintNULLNULL19100NULLNULLNULLNULLNULLNULLNULLNULLNULLNULL
FullNameViewpointdbovbudServiceSalesPlanFullName13NULLYESvarchar8383NULLNULLNULLNULLNULLNULLiso_1NULLNULLLatin1_General_BINNULLNULLNULL

 

I created a custom column Salesman_Key in udService_Sales which consisted concatenating of a copy of the column ARCo (changed to text) and udSALESMAN (Changed to text).

 

I created a custom column Salesman_Key in vbudServiceSalesPlan which consisted concatenating of a copy of the column Co (changed to text) and Employee (Changed to text).

 

I then created a relationship between the two tables with a one to many (vbudServiceSalesPlan --> udServiceSales.

 

I created a custom column TotalYTDSales = CALCULATE(sum(udService_Sales[Invoiced]), YEAR(udService_Sales[Mth])=2017)

 

I then attempted to create the Measure YTD % of Plan = udService_Sales[TotalYTDSales]/vbudServiceSalesPlan[Plan_YTD_Sales]

 

This is when the error was generated "A single value for column 'Plan_YTD_Sales' in table 'vbudServiceSalesPlan' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.".

@ddeutschman

 

Hi, exist this measure: 

 

vbudServiceSalesPlan[Plan_YTD_Sales]

 

Or is a column?




Lima - Peru

It is a column Plan_YTD_Sales = [Months]*[Plan_Monthly_Sales]

@ddeutschman

 

You only need to add a aggregation in the % Formula.

 

YTD % of Plan = udService_Sales[TotalYTDSales]/sum(vbudServiceSalesPlan[Plan_YTD_Sales])

 

Assuming that ServiceSalesPlan have only 1 year. If is not you i recommend create a measure to filter the year.

 




Lima - Peru

That worked.  Thank You!

I will provide the views althought I ran into an issue creating the scripts today.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors