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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Compare two adjacent records in a chart

Hi

I am generating the below chart and I would like to be able to campare any two adjacent values in it

I thought of using the ERLEIER function that would give me the value of the point before the current one.

Comunity power  BI.PNG

 

 

The way I see it, it would give me something like this.
Previous Val = CALCULATE([Value]);FILTER(MyTable; EARLIER(MyTable[Batch_number])<MyTable[Batch_number]))
 
The problem is that MyTable[Batch_number] is a string variable and the smaller operator (<) doesn't seem to be working.
 
An idea on how I can atcheave my goeal ?
 
Thanks for the help
 
 

 

 

1 REPLY 1
Nathaniel_C
Super User
Super User

Hi @Anonymous ,

Measure = 
var _curr = MyTable[Batch_number]
var _calc = CALCULATE(MAX(MyTable[Batch_number]),MyTable[Batch_number]<curr)
return _calc

It will be something like this, but not exactly because you did not provide enough info. Your column names would at least be helpful. However maybe this will give you the idea.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Please read this post to get your question answered more quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors