Forum Discussion
Shamatix
7 years agoPost Partisan
SUM function only accepts column reference as an Argument
Hey fellow power bi users, I am getting the following error: SUM function only accepts column reference as an Argument My DAX is as follow: Column = SUM(IF(AND(WEEKNUM(Data[dte_invduedate...
- 7 years ago
Hi Shamatix
it seems you write a column to put the formula which should be put in a measure.
If you'd like a column more than a measure, you could write columns as below:
total amount for all row
Column = IF ( AND ( WEEKNUM ( Data[dte_invduedate], 2 ) >= WEEKNUM ( TODAY (), 2 ), YEAR ( Data[dte_invduedate] ) <= YEAR ( TODAY () ) ), SUM ( Data[TotalAmount] ), 0 )total amount for each row
Column = IF ( AND ( WEEKNUM ( Data[dte_invduedate], 2 ) >= WEEKNUM ( TODAY (), 2 ), YEAR ( Data[dte_invduedate] ) <= YEAR ( TODAY () ) ), CALCULATE ( SUM ( Data[TotalAmount] ) ), 0 )Best Regards
Maggie
riteshgaur
7 years agoFrequent Visitor
Hi,
You should put your SUM inside a CALCULATEE function and apply required filters then.
Regards
Ritesh
- Shamatix7 years agoPost Partisan
How so?
Column = CALCULATE(SUM(IF(AND(WEEKNUM(Data[dte_invduedate];2) >= WEEKNUM(TODAY();2); YEAR(Data[dte_invduedate]) <= YEAR(TODAY()));Data[TotalAmount];0)))Brings me errors