Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I'm trying to create a previous month's sales as a calculated column, I've created this in Measure easily however I don't know how to do this as Calc Column. Can someone help? Thank you!
Criteria: Acct and Item should be the same
Note: I have 5 Million rows, when I try to do some testing calc it crashes my PBI. It would help if the calculation is friendly to large data sets.
Date | Acct | Item | Sales | PrevMonthSales |
1/01/2022 | 123456 | A | 10000 | |
1/01/2022 | 123456 | B | 15000 | |
2/01/2022 | 123456 | A | 20000 | 10000 |
2/01/2022 | 123456 | B | 18000 | 15000 |
Solved! Go to Solution.
@kevinedora , oh you do not have date,
First create period rank column
period Rank = rankx(Table, [period],,asc, dense)
then create a new column
sumx(filter(Table, Table[Acct] =earlier([Acct]) && [Item] = earlier([Item]) && [period Rank ]=earlier([period Rank]) -1 ) , [Sales])
@kevinedora , Create a new column
sumx(filter(Table, Table[Acct] =earlier([Acct]) && [Item] = earlier([Item]) && eomonth([date],0) =_date) , [Sales])
@amitchandak It's not working. It's all blank. Maybe I've done something wrong? Please see screenshot below
@kevinedora , oh you do not have date,
First create period rank column
period Rank = rankx(Table, [period],,asc, dense)
then create a new column
sumx(filter(Table, Table[Acct] =earlier([Acct]) && [Item] = earlier([Item]) && [period Rank ]=earlier([period Rank]) -1 ) , [Sales])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |