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

Comparing between the value of current entry and previous entry to see if there is any peculiarity

I'm currently trying to do two things here.


First and foremost, I would like to check the value inside a column called [percentage] and to cehck whether the latest entry has less value comparing to previous entry or not. The entry is submitted on a weekly basis. For example, if the entry of last two 2 weeks was 90% the entry of last week should only be equal or more than 90% if the user submit something that is less than 90% it should show a warning message telling the user that that was an abnormal entry.

 

I also want to check on an entry that was reported active two weeks ago (0-99%) but is not reported last week to simply put I just want to check if the user forget to submit another entry last week to show that he/she has completed 100%.

5 REPLIES 5
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Have a look at this blog

 

https://community.powerbi.com/t5/Community-Blog/Getting-Previous-Values-in-Power-BI-Part-1/ba-p/1143370

 

 

Try getting the previous value and then compare both of these to check for any pecularity.

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

lbendlin
Super User
Super User

Assuming that your weekly events have a date stamp of sorts (the day they were submitted) you can do the following

 

1. find the item in the current context. Most of the time you use SELECTEDVALUE() or MAX() for that

 

var latest = selectedvalue(transactions[datestamp])

 

2. Find the largest date value that is smaller than the value you just defined

 

var previous = calculate(max(transactions[datestamp]), filter (all(transactions),transactions[datestamp]<latest))

 

And from there you can glean both the percentage reported on that day, and the date difference (to see if they skipped a report).

Anonymous
Not applicable

var latest = selectedvalue(transactions[datestamp]) = works
var previous = calculate(max(transactions[datestamp]), filter (all(transactions),transactions[datestamp]<latest)) = doesn't show any values

Hi @Anonymous ,

 

Create a measure

 

Measure = 

 

var latest = MAX(transactions[datestamp])

 

RETURN

calculate(max(transactions[datestamp]), filter (all(transactions),transactions[datestamp]<latest)) 

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Anonymous
Not applicable

dominicpowerbi_0-1592916613451.png

I've got the value of the entry dates for both previous week and last 2 weeks. 
Now my question is how do I check if the user forgot to submit another entry last week on the course that he/she haven't completed.
Here are the list of available columns. EntryDate, Course Name, Percentage. 

So what I want to do isto check the values of percentage on a particular course during the entry of last week and the week before that. Actually I might even need to check the 3 week before as well. 

Here is the scenario, every user has to submit the form on a weekly basis.
USER A submit an entry regarding course Database and has finished 50% of it on June 5 2020. (3 weeks ago)
USER A did not submit any entry on 12 June 2020. (2 weeks ago)
USER A submit another any entry. However, this entry is for another course that isn't Database on 19 June 2020. (1 weeks ago)
I want the system to be able to check and give the warning to USER A that he might forgot to submit another entry regarding Database because normally if his progress was still 50% after a few weeks he's still supposed to submit an entry to keep updating the supervisor. 

The logic that I could think of is this following logic
If MAX(percentage) is not equal to 100% and there is no update during previous entry and last two weeks entries then returns "You might have forgotten to update the course progress" else "You have no warning" 

I want to have someting like this but I don't really know how to transform it into DAX
Thank you for your help in advance 🙂

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.