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 / Need to fetch latest d...
Power Apps
Unanswered

Need to fetch latest date for a record in every month and display in gallery [Last 6 months]..

(0) ShareShare
ReportReport
Posted on by 6

 Here I am sharing the snapshot of result expected.

kavin12_0-1698945969396.png

 

My requirement should be,

For each indicator,we got values from columns result,RR,RE and mapped to specific date in a month.

And few cases,we got more than one date for the same indicator in a particular month,then we need to consider higher value of process id and display that one for that specific month..For example (Below Screenshot)

 

kavin12_2-1698946827520.png

Here Indicator#2(pink color)  came two times in a same month (2023-06) and we need to consider higher value of processid (25) and display in a gallery..

 

Based on above requirement,I tried few one on my own:

I was able to filter the lastest date for every month..

 

Screen OnVisible Property:

Set(a,Value(Concatenate(First(Split(Text(DateAdd(Now(),-6,TimeUnit.Months),"yyyy-mm"),"-")).Value, Last(Split(Text(DateAdd(Now(),-6,TimeUnit.Months),"yyyy-mm"),"-")).Value)));

Set(b,Value(Concatenate(First(Split(Text(Now(),"yyyy-mm"),"-")).Value, Last(Split(Text(Now(),"yyyy-mm"),"-")).Value)));

 

Gallery Item property:

SortByColumns(Filter(ColDataPortal, Value(Period)>a && Value(Period)<=b),"Process_ID",SortOrder.Ascending)

 

My screen will be looking like totally wrong (Below screenshot)

 

kavin12_3-1698948566858.png

 

 

Please suggest anyone,how to get 6 month data and mapped with right indicator name and display in gallery.(Below screenshot).

 

kavin12_4-1698948853717.png

 

 

 

 

 

Categories:
  • kavin12 Profile Picture
    6 on at

    Hello frnd,Thank you for your time to respond... Still I am facing bit complexity in requirement...

    By using in gallery item below formula to fecth last six month data... 

    SortByColumns(Filter(ColDataPortal,DataElement_name=ThisItem.Value && (Value(Period)>a && Value(Period)<=b)),"Period",SortOrder.Descending)

     

    kavin12_0-1699030038654.png

     

    Issue 1:The problem is getting two dates from same month(Red circle one),I need to fetch first date irrespective of duplicates again..

    Issue 2: The above mentioned month are dynamic header..Calculating current month - 5 and display in 6 varables.I need to map exact month data with month header..Ex: For one indicator,I got 6 month report mean,need to align properly from nov to jun 2023..And If one indicator got only august and july report mean,

    I need to align it exactly with august and july..

     

    Please suggest any idea to achieve it..

  • kavin12 Profile Picture
    6 on at

    Hi Muhammad, The issue got resolved,thanks for your time.. The SQL person sorted out to get date in every month and  am using that column to display for my requirement

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard