Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there,
I have a table like that:
What I want to do is, getting the previous row value as shown below. There are multiple "MagazaKodu" and "FaturaSaati". I want to get previous values according to both "MagazaKodu" and "FaturaSaati". How can I handle this? I have tried "EARLIER" function but it did not work.
| MagazaKodu | FaturaSaati | FaturaSayisi | Previous Value |
| 3004 | 9 | 26 | |
| 3004 | 10 | 1167 | 26 |
| 3004 | 11 | 2113 | 1167 |
| 3004 | 12 | 2970 | 2970 |
| 3004 | 13 | 3388 | 3388 |
| 3004 | 14 | 3801 | 3801 |
| 3004 | 15 | 4204 | 4204 |
| 3004 | 16 | 4561 | 4561 |
Solved! Go to Solution.
@Anonymous,
Create a caclulated column using DAX below.
previous value = CALCULATE(FIRSTNONBLANK(Table1[FaturaSayisi],1),FILTER(Table1,Table1[MagazaKodu]=EARLIER(Table1[MagazaKodu])&&Table1[FaturaSaati]=EARLIER(Table1[FaturaSaati])-1))
Regards,
Lydia
I have a similar situation, I need cumulative Sum, but I get a circular dependency error when I create a calculated column
Hi ,
Can you help me on my solution i need somthing like this only diffrence is when i filter i want to show all the values cummilative
Hi @Anonymous,
Thanks a lot. It helped me.
Best regards..
@Anonymous,
Create a caclulated column using DAX below.
previous value = CALCULATE(FIRSTNONBLANK(Table1[FaturaSayisi],1),FILTER(Table1,Table1[MagazaKodu]=EARLIER(Table1[MagazaKodu])&&Table1[FaturaSaati]=EARLIER(Table1[FaturaSaati])-1))
Regards,
Lydia
Very handy, Lydia @Anonymous ! Thanks for sharing!
By the way, in my case I used it to calculate the previous date value, replacing
Table1[FaturaSaati]=EARLIER(Table1[FaturaSaati])-1)
by
Table1[Date]=EARLIER(Table1[Date])-1)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 25 |
| User | Count |
|---|---|
| 124 | |
| 87 | |
| 70 | |
| 66 | |
| 65 |