Forum Discussion
SUM function only accepts column reference as an Argument
- 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
themistoklis wrote:
Try the following formula on a Measure and not Calculated column
Measure = CALCULATE ( SUM ( Data[TotalAmount] ); FILTER ( ALL ( Data ); WEEKNUM ( Data[dte_invduedate]; 2 ) >= WEEKNUM ( TODAY (); 2 ) && YEAR ( Data[dte_invduedate] ) <= YEAR ( TODAY () ) ) )
Hey Themis,
Thanks for the try, but didnt work.
As you can see it gives me the sum of ALL the rows in each row, I just want TotalAmount pr row where the statement at the top is valid, if it aint valid it should print 0,00 rather than the TotalAmount for the row.
Can you please share with us the raw data or the workspace itself?
Also if you want to send an image with the desired output that would be great.
On the image this is the background table. What do you want toshow on PowerBi report though.
Which fields and measures?