cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
husss Regular Visitor
Regular Visitor

DAX getting previous value

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.

 

MagazaKoduFaturaSaatiFaturaSayisiPrevious Value
3004926 
300410116726
30041121131167
30041229702970
30041333883388
30041438013801
30041542044204
30041645614561

 

aaa.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator v-yuezhe-msft
Moderator

Re: DAX getting previous value

@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))

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Moderator v-yuezhe-msft
Moderator

Re: DAX getting previous value

@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))

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

husss Regular Visitor
Regular Visitor

Re: DAX getting previous value

Hi @v-yuezhe-msft,

 

Thanks a lot. It helped me.

 

Best regards.. 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 208 members 1,974 guests
Please welcome our newest community members: