cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Distinct last year from a date column

Hi Team,

I need distinct current year-1 from a date column based on the dropdown selected for client.

DateClient
1/1/2020ABC
1/1/2020ABC
1/1/2020ABC
1/1/2020ABC
1/1/2020ABC
1/1/2020ABC
1/1/2020ABC
2/1/2020BCD
2/1/2020BCD
2/1/2020BCD
2/1/2020BCD
2/1/2020BCD
2/1/2020BCD
2/1/2020BCD
1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

Try this:

Distinct(Filter(SOC_Assessment_Responses,Client_Name = Dropdown1.Selected.Result),Text(Date,"yyyy-m")).Result

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

5 REPLIES 5
eka24
Super User
Super User

Consider this:

Distinct(Datasource,Text(Date,"yyyy"))
 
Or
Distinct(Datasource,Text(DateValue(Date),"yyyy"))
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
 
Anonymous
Not applicable

@eka24 

I want current year-1.That means 2021-1 =2020 from the date column based on the client selected from dropdown from client column.

eka24
Super User
Super User

Please show a screen shot of the current formula on the Items of the Dropdown

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

@eka24 .

This is the formula I am using now as dropdown, which allows user to select the year.

Distinct(Filter(SOC_Assessment_Responses,Client_Name = Dropdown1.Selected.Result),Year(Date)).Result

 

But I want to hardcode it to current year-1.

 

eka24
Super User
Super User

Try this:

Distinct(Filter(SOC_Assessment_Responses,Client_Name = Dropdown1.Selected.Result),Text(Date,"yyyy-m")).Result

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,615)