Forum Discussion
Anonymous
4 years agoNot applicable
Very simple calculation question
I have one Table with 3 columns in PowerBI. I am trying to make a calculated column - "PrevNumber" PrevUniqueID will always have a match in the UniqueID column of a different Row. Goal is to...
- Anonymous4 years ago
Hi Anonymous ,
Try this code to create a calculated column.
PreviousMonthNumber = VAR _PreMonthUniqueID = CALCULATE ( SUM ( 'Table'[Number] ), FILTER ( 'Table', 'Table'[UniqueID] = EARLIER ( 'Table'[PreMonthUniqueID] ) ) ) RETURN _PreMonthUniqueID + 0Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Anonymous ,
Try this code to create a calculated column.
PreviousMonthNumber =
VAR _PreMonthUniqueID =
CALCULATE (
SUM ( 'Table'[Number] ),
FILTER ( 'Table', 'Table'[UniqueID] = EARLIER ( 'Table'[PreMonthUniqueID] ) )
)
RETURN
_PreMonthUniqueID + 0
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.