Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
v-yuezhe-msft
Employee
Employee

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

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

4 REPLIES 4
vishakhawali
Frequent Visitor

I have a similar situation, I need cumulative Sum, but I get a circular dependency error when I create a calculated column

Anonymous
Not applicable

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 

Anonymous
Not applicable

Hi @v-yuezhe-msft,

 

Thanks a lot. It helped me.

 

Best regards.. 

v-yuezhe-msft
Employee
Employee

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

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.