cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vmusthu786
Frequent Visitor

how to add column by criteria in Datatable

Hi,

Have some list and the date of that meeting in next column. please refer the pic and i want result in DataTable as shown in picture. Individually (by using a dropdown )i was manged to get the result by using Concat formula but need to have same in datatable (title column are only few example there more than 100 unique line items in the list). any help appreciated. Thanks 

Crop.png

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

You can use the GroupBy function to group the original table into the meeting type, then use the AddColumns function to add a new column with the dates joined by the Concat function, like in the example below:

AddColumns(
    GroupBy(
        Table,
        "Title",
        "ByTitle"),
    "Dates",
    Concat(ByTitle, Text(Date, "dd/mm/yyyy"), ", "))

The attached app shows an example of this scenario. To open it, save it locally, then go to https://create.powerapps.com, select Open -> Browse, then find the file that you saved before.

Hope this helps!

View solution in original post

4 REPLIES 4
timl
Super User
Super User

Hi @vmusthu786 

If you set the Items property of datatable to something like this, it should give you the result that you're looking for.

 

AddColumns(GroupBy(YourTable, "Title", "Details"),
"CombinedDates",
Concat(Details,Date & ",")
)

This formula calls the AddColumns function to add a column called CombinedDates. CombinedDates will Concat the date values in YourTable.

 

CarlosFigueira
Power Apps
Power Apps

You can use the GroupBy function to group the original table into the meeting type, then use the AddColumns function to add a new column with the dates joined by the Concat function, like in the example below:

AddColumns(
    GroupBy(
        Table,
        "Title",
        "ByTitle"),
    "Dates",
    Concat(ByTitle, Text(Date, "dd/mm/yyyy"), ", "))

The attached app shows an example of this scenario. To open it, save it locally, then go to https://create.powerapps.com, select Open -> Browse, then find the file that you saved before.

Hope this helps!


@CarlosFigueira wrote:

You can use the GroupBy function to group the original table into the meeting type, then use the AddColumns function to add a new column with the dates joined by the Concat function, like in the example below:

AddColumns(
    GroupBy(
        Table,
        "Title",
        "ByTitle"),
    "Dates",
    Concat(ByTitle, Text(Date, "dd/mm/yyyy"), ", "))

The attached app shows an example of this scenario. To open it, save it locally, then go to https://create.powerapps.com, select Open -> Browse, then find the file that you saved before.

Hope this helps!


Hi,

Thanks for the reply, i tried with your suggestion with this code all the dates are coming to Column irrespective of the meeting line item. request you to suggest me with some other solution for this. I'm totally new to this. Hope you understood my requirement



Can you provide more information on your issue? Which expressions you are using for the data table? If you add a data table that points directly to your Excel table, does it show the data that you expect? What do you mean by "all the dates are coming to Column irrespective of the meeting line item" - can you show what you get? Thanks!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,528)