Announcements
My app takes only one entry within a QTR for a Country and Brand, so for UK in QTR2 of 2023 the app will take only one entry per brand.Now I want my gallery to show only the most recent entry basis the QTR field so that there is only one line item per Country & Asset.Also pls note my gallery is allowing filtering using 3 dropdowns so that part will remain as is.Data as of now (Recent items highlighted):
Desired output:
Hi @OnlyGooner ,
We created the data source below.
Please this in the Items of Gallery:
ForAll(Distinct('0720-2',Concatenate(Project,Region,Country)), LookUp(SortByColumns('0720-2',"QTR",SortOrder.Descending),Value = Concatenate(Project,Region,Country)))
Hope this will help you,
Best Regards,Tina
Hi,
have you tried using GroupBy() function?
GroupBy( DataSource, "QTR", /*name of the column*/ "Group" )
Then use "Last()" function on a label to get the most recent value:
Last(ThisItem.Group).Region Last(ThisItem.Group).Country Last(ThisItem.Group).Product
I hope it helps 🙂
Can you pls help me in combining your code with the below to allow the use of dropdowns:If(IsBlank(cmb_Country_gal) Or IsBlank(cmb_Brand_gal) Or IsBlank(cmb_regn_gal) Or IsBlank(cmb_qtr_gal),Filter('MyDataSource',IsBlank(cmb_regn_gal.Selected.REGION) || false || Region = cmb_regn_gal.Selected.REGION,IsBlank(cmb_Country_gal.Selected.Result) || false || Country = cmb_Country_gal.Selected.Result,IsBlank(cmb_Brand_gal.Selected.Result) || false || Brand = cmb_Brand_gal.Selected.Result),'MyDataSource')
Of Course!
I made a simple for you to Test if it worked.
You just need to replace 'MyDataSource' the formula you wrote into
Here is the Test.
Got it working now, I was being a noob.Many Thanks
One quick help on this, instead of QTR that holds numeric values, if I have to do it on another column that holds alphanumeric values like Q2'2023, how do I do it?
@v-hanytian-msft Pls respond. If anyone else can help it will be greatly appreciated.
Please try this:
Concatnate("Q",Left(String,1),"'",Right(String,4))
@v-hanytian-msft Original formula was this, I tried the concatenate formula from end as well to replace "QTR_Year" within SortBy Columns but it doesn't work.Not use If need to use Addcolumns here? Pls help.
ForAll(Distinct('Impact Metrics Performance Input App',Concatenate(Asset,Region,LOC)), LookUp(SortByColumns('Impact Metrics Performance Input App',"QTR_Year",SortOrder.Descending),Value = Concatenate(Asset,Region,LOC))
Don't bother, picked up 'Created date' col available in my SharePoint list
Thank you again!
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.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 494
WarrenBelz 352 Most Valuable Professional
11manish 323