Forum Discussion
Anonymous
4 years agoNot applicable
Create New Column Referencing Prev Month Row
Hello,
I am trying to create a column in Power BI that will be equal to the the value for the same item one month ago.
The LastMonths Balance is the new column and needs to be equal to the balance for the same category last month.
| Date | Category | Balance | LastMonths Balance (New Column) |
11/30/21 | 1 | 1000 | null |
| 12/31/21 | 2 | 2000 | null |
| 1/31/21 | 3 | 3000 | null |
| 11/30/21 | 1 | 1500 | 1000 |
| 12/31/21 | 2 | 2500 | 2000 |
| 1/31/21 | 3 | 3500 | 3000 |
@ , Try a new column like
new column =
var _item = [category]
var _date = eomonth([date],-1)
return
sumx(filter(Table, [category] =_item && eomonth([date],0) = _date), [Balance])
1 Reply
- amitchandakSuper User
@ , Try a new column like
new column =
var _item = [category]
var _date = eomonth([date],-1)
return
sumx(filter(Table, [category] =_item && eomonth([date],0) = _date), [Balance])