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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors