cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoseC12
Helper V
Helper V

Distinct function

Good evening,

I have a combo box where I select dates, but I have some days assigned per week. For example: 1 week has 7 days assigned:
Disctinct.PNG

This is my SharePoint records samples:
Dates.PNG

The formula right now is:

 

Distinct(Filter(CALENDARIO;SEMANA=Input_SemanaTarea.Selected.Result);FECHA)

Or maybe it could be only Filter function

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @JoseC12 ,

Could you describe more clearly about your problem?

Based on your description, I could not understand about what you want.

Do you want to filter fecha  based on the selection of semana?

Is the semana combo box multiple choice?

If there's no-repeated value in fecha field, you could just set the fecha combo box to this:

Filter(CALENDARIO;SEMANA=Input_SemanaTarea.Selected.Result)

 If the the semana combo box is multiple choice, you need to set the fecha combo box to this:

Filter(CALENDARIO;SEMANA in Input_SemanaTarea.SelectedItems.Result)

If there's repeated value in fecha field, you need to use Distinct function like you mentioned:

Distinct(Filter(CALENDARIO;SEMANA=Input_SemanaTarea.Selected.Result);FECHA)

or:

Distinct(Filter(CALENDARIO;SEMANA in Input_SemanaTarea.SelectedItems.Result);FECHA)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
eka24
Super User III
Super User III

You have not stated the problem clearly on what you want to achieve.
However if I understand you, you separate the Distinct and rather use it on the Combobox. Example: Distinct(TableName,Fecha)
Then filter:
Filter(CALENDARIO;SEMANA=Input_SemanaTarea.Selected.Result)
v-yutliu-msft
Community Support
Community Support

Hi @JoseC12 ,

Could you describe more clearly about your problem?

Based on your description, I could not understand about what you want.

Do you want to filter fecha  based on the selection of semana?

Is the semana combo box multiple choice?

If there's no-repeated value in fecha field, you could just set the fecha combo box to this:

Filter(CALENDARIO;SEMANA=Input_SemanaTarea.Selected.Result)

 If the the semana combo box is multiple choice, you need to set the fecha combo box to this:

Filter(CALENDARIO;SEMANA in Input_SemanaTarea.SelectedItems.Result)

If there's repeated value in fecha field, you need to use Distinct function like you mentioned:

Distinct(Filter(CALENDARIO;SEMANA=Input_SemanaTarea.Selected.Result);FECHA)

or:

Distinct(Filter(CALENDARIO;SEMANA in Input_SemanaTarea.SelectedItems.Result);FECHA)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hello guys, I'm sorry I couldn't describe clearly the problem.

First, I have a list called 'CALENDARIO', where I registered all the dates of the year:
Calendario columns.PNG

Every date(FECHA) has a week(SEMANA) and a month(MES)

Then I have the list 'TAREA' and I inserted a column called 'FECHA' which is a Lookup Column from list 'CALENDARIO' (I selected 'FECHA column which type is 'Date and Time' but I only use Date)

Lookup Column.PNG

In the edit form, by default the formula is 'Choices(TAREA.FECHA)' in the combobox Items property,

App.PNG

Now, if I select a Week, for example '01/01 - 05/01 (SEMANA 1)', I need to filter all the dates in the ComboBox that belongs to that week selected.

Calendario Values.PNG

In this example I want in that ComboBox to appears from '1/1/2020/ to '1/5/2020'

Do you understand now? Let me know please

Thanks 

Jose

 

Hi, @v-yutliu-msft 

There is no repeated values, I put 

 

Filter(CALENDARIO;SEMANA in Input_SemanaTarea.Selected.Result)

 

And it resulted:

CAPTURE.PNG 

There are 7 spaces but as I see Value shows 'ComplianceAssetId' column which I cannot change into 'Fecha' column:
ComplianceAssetId.PNG

I checked and I replaced 'in' into '=':

 

Filter(CALENDARIO;SEMANA = Input_SemanaTarea.Selected.Result)

 

It filtered but doesn't save the Date

 

It only works with Choices(TAREA.FECHA)

 

Hello again guys,

what I did is to replace the Lookup column into a Date&Time column so I put in the Items property:

Filter(CALENDARIO;SEMANA = Input_SemanaTarea.Selected.Result)

and now it saves

Thanks a lot

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (70,796)