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

getting previous value

hi all..

perhaps it a silly question but do i get the previous value of a column?

i tried lookup value & earlier but got lost in them.any help.

thank you.

Capture.JPG

2 ACCEPTED SOLUTIONS
sanalytics
Solution Supplier
Solution Supplier

Hey @Anonymous ,

Take this as solution,

you may need a spporting column or Index for this 

 

supporting col = RANKX('Table',[DIGITS],,ASC)

 

Then, you calculate previous value by that supporting col..

Previous Value = CALCULATE(FIRSTNONBLANK('Table'[DIGITS],TRUE()),FILTER('Table','Table'[Supporting Col] = EARLIER('Table'[Supporting Col])-1) )
 
Regards,
Snandy
If this is your solution, Please accept it as solution..It will help others

View solution in original post

az38
Community Champion
Community Champion

@Anonymous 

smth like that

Diff = if(isblank([Previous]); BLANK(); [digits]-[previous])

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

5 REPLIES 5
sanalytics
Solution Supplier
Solution Supplier

Hey @Anonymous ,

Take this as solution,

you may need a spporting column or Index for this 

 

supporting col = RANKX('Table',[DIGITS],,ASC)

 

Then, you calculate previous value by that supporting col..

Previous Value = CALCULATE(FIRSTNONBLANK('Table'[DIGITS],TRUE()),FILTER('Table','Table'[Supporting Col] = EARLIER('Table'[Supporting Col])-1) )
 
Regards,
Snandy
If this is your solution, Please accept it as solution..It will help others
az38
Community Champion
Community Champion

Hi @Anonymous 

if your data is so simple you could try a column

Column = calculate(LASTNONBLANK(Query[Digits];1);filter(all(Query);Query[Digits]<EARLIER(Query[Digits])))

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 @sanalytics 

Thanks, both methods works for me...

1 more question, as i used the previous value to calculate the difference.

my chart (using the diff column) will show as follow.

is there a way not to show the first value..in this case, would be the value 110 in column "Diff"

 

1.JPG123.JPG

az38
Community Champion
Community Champion

@Anonymous 

smth like that

Diff = if(isblank([Previous]); BLANK(); [digits]-[previous])

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hey @Anonymous 

 

Re create your Diff Col.
if(ISBLANK(Prev),Blank(),Diff)

then go tho the visual level filter and deselect the blank from the diff .

Hope it will helps,

Regards,

Snandy

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.