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

Variable Virtual Table column reference

Hi guys,

 

I need to combine select column from two tables and then run a calc over the top of the union of these two tables but am having trouble pulling out the reference columns and running the calc. For some reason, it doesn't want to recognise the column names from the variables above. 

 

below is the code I'm using 

 

Combined Weighted Avg LVR = 

var c_pipelinetable = SELECTCOLUMNS(FILTER('DB Pipeline','DB Pipeline'[Pr] = "xxx"),
                                     "c_Account", 'DB Pipeline'[Application ID],
                                     "c_LVR_by_Loan_Amount", 'DB Pipeline'[LVR by Loan Amount],
                                     "c_Loan_Amount", 'DB Pipeline'[Loan Amount])

var c_settledtable = SELECTCOLUMNS(FILTER('Dataset - Development Environment',CONTAINSSTRING('Dataset - Development Environment'[Product_Description],"xxx")),
                                    "c_Account", 'Dataset SPV - Development Environment'[Account_Number],
                                    "c_LVR_by_Loan_Amount", 'Dataset SPV - Development Environment'[LVR by Loan Amount],
                                    "c_Loan_Amount", 'Dataset SPV - Development Environment'[Principal_Balanace])

var _PipelineSettled_table = UNION(c_pipelinetable,c_settledtable)

return

CALCULATE(sum(c_Loan_Amount))

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @adin ,

 

According to your dax formula, the reason for the error is that the parameter of the sum function comes from a specific column in the data source, and "c_Loan_Amount" in the above expression is a virtual column created. Therefore an error is returned.

refer to official document: SUM function (DAX) - DAX | Microsoft Docs

v-henryk-mstf_0-1616983726947.png

 


If it still doesn't solve your problem, can you provide test data (delete sensitive information), because I can't do further tests with the formula alone. Looking forward to your reply.

Best Regards,
Henry

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

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @adin ,

 

According to your dax formula, the reason for the error is that the parameter of the sum function comes from a specific column in the data source, and "c_Loan_Amount" in the above expression is a virtual column created. Therefore an error is returned.

refer to official document: SUM function (DAX) - DAX | Microsoft Docs

v-henryk-mstf_0-1616983726947.png

 


If it still doesn't solve your problem, can you provide test data (delete sensitive information), because I can't do further tests with the formula alone. Looking forward to your reply.

Best Regards,
Henry

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

adin
Helper I
Helper I

The error I'm getting is "the SUM function only accepts a column reference as an argument."

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.