web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to query informati...
Power Apps
Unanswered

How to query information from a previous record.

(0) ShareShare
ReportReport
Posted on by 39

I have a Canvas app that is connected to a Dataverse. This app is used for performance evaluations of technicians. I need a way to determine if this technician was scored in their previous evaluation for the same item.

 

For example, in 'Fulano's' evaluation, he was late last month, so he was scored on 'Punctuality.' This month, he was late again, which is a recurrence in the 'Punctuality' item.

 

One way to check if he was scored is to compare the score he received in 'Punctuality' with the maximum score for 'Punctuality.' If they are different, he was scored.

 

In my table, I have columns for the Month, Year, and the Month and Year combined, but I don't want to rely on this data for the search as it could create future issues.

 

I always need to check for this recurrence, and it is cumulative. However, for it to be considered a recurrence, the occurrences must be in sequence. For example, if he was scored in February and failed again in March, 'Recurrence = 1'; if he failed again in April, 'Recurrence = 2'; but if he didn't make the same mistake in May, 'Recurrence = 0.' These values are stored in a column in Dataverse.

 

Does anyone have any ideas on how to do this?

tela - dataverse.png
tela avaliar.png
Categories:
  • BCBuizer Profile Picture
    22,895 Super User 2026 Season 2 on at

    Hi @FelipeQuagio ,

     

    What you can do is to set the DataCardValue.Default property for the column that stores recurrence to:

    With(
    	{_PreviousMonth: LookUp(
    		'2-Avaliacao-Tecnicos',
    		Month = Month( 
    			DateAdd( 
    				Today(),
    				-1,
    				TimeUnit.Months
    			)
    		) &&
    		Year = Year(
    			DateAdd(
    				Today(),
    				-1,
    				TimeUnit.Months
    			)
    		) &&
    		'Punctuality score' <> 'Maximum punctuality score'
    	)},
    	If(
    		IsBlank(_PreviousMonth),
    		0,
    		_PreviousMonth.Recurrence +1
    	)
    )

     This checks records for the previous month and if one is found, it will increase the value by 1. If none is found, the value is set to 0.

     

    You'll have to replace some of the column names in there to match your names because unfortunately I don't understand them.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard