Forum Discussion
ythiart
6 years agoRegular Visitor
Column: Total per customer
HI all I am quite new to Power BI and Dax and would appreciate your help. I have two tables, one has the customer information like credit limit, etc and is one line per customer. The other table...
- Anonymous6 years ago
// If your 'Customer Info' table is a big one // you can still add a calculated column to it // but I'd advise against using CALCULATE // since it may be very slow. CALCULATE // requires context transition and this is // costly. You'll be better off using this // instead (which does not use CALCULATE): [Cust Total] = // calculated column in 'Customer Info' var __currentCust = 'Customer Info'[CustId] return SUMX( filter( 'Customer Info', 'Customer Info'[CustId] = __currentCust ), 'Customer Info'[Amount] )Best
D
Anonymous
6 years agoNot applicable
// If your 'Customer Info' table is a big one
// you can still add a calculated column to it
// but I'd advise against using CALCULATE
// since it may be very slow. CALCULATE
// requires context transition and this is
// costly. You'll be better off using this
// instead (which does not use CALCULATE):
[Cust Total] = // calculated column in 'Customer Info'
var __currentCust = 'Customer Info'[CustId]
return
SUMX(
filter(
'Customer Info',
'Customer Info'[CustId] = __currentCust
),
'Customer Info'[Amount]
)
Best
D