- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
DAX getting previous value
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-14-2018 11:43 PM
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.
Accepted Solutions
Re: DAX getting previous value
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-15-2018 11:19 PM
@husss,
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
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
All Replies
Re: DAX getting previous value
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-15-2018 11:19 PM
@husss,
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
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Re: DAX getting previous value
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-03-2018 09:37 AM