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

Displaying values in a nested gallery based on values from other galleries.

Hello, 

 

I have 3 data sources. Table A which is my main table with all the records and all the columns, it looks like this:

 

NameDateValue
Name 101.011
Name 102.012
Name 1 03.013
Name 2 01.011

 

the other 2 tables are Table B which is a list of unique Names from Table A and Table C which is a list of unique Dates from Table A (I am doing it because od delegation issue). 

 

I need to display my data in such way:

 

 01.0102.0103.01
Name 1123
Name 2 123
Name 3111

 

For my needs it must be a vertical gallery (with my unique names from table B as a data source) with a second horizontal gallery nested inside it (I have no idea whether I should use Table A or Table C as a data source)

 

I can imagine that I will create a third horizontal gallery (again with table C as a data source) above both of them with my unique Dates but I really can't find a way to display my Values in the second horizontal gallery that will match corresponding Name from the first gallery and will match the order of Dates from the third gallery. I would really appreciate your help. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Termigez1 :

Firstly,A gallery control can only achieve one level of nesting, that is to say, in a sub-gallery, you cannot nest another gallery.

Secondly,If you just want to display the data in the following format, I suggest you use the following method.

 01.0102.0103.01
Name 1123
Name 2 123
Name 3111

My data source:

1.JPG

Solution1:

1\Add a Gallery

Items:

 

TableB

 

2\Add a lable into this gallery

Text

 

ThisItem.Name

 

3\Add a sub-gallery into this gallery

Items

 

Filter(TableA,ThisItem.Name=Name)

 

Or(If you need to sum up Value)

 

AddColumns(GroupBy(Filter(TableA,ThisItem.Name=Name),"Date","TheGroup"),"Value",Sum(TheGroup,Value))

 

4\Add a label into this sub gallery

Text

 

ThisItem.Date

 

5\Add a label into this sub gallery

Text

 

ThisItem.Value

 

2.JPG

Solution2:

1\Add a datatable control and set it's items property to:

 

AddColumns(
    TableB,
    "01.01",
    LookUp(
        TableA,
        Name = TableB[@Name] && Date = "01.01"
    ).Value,
    "02.01",
    LookUp(
        TableA,
        Name = TableB[@Name] && Date = "02.01"
    ).Value,
    "03.01",
    LookUp(
        TableA,
        Name = TableB[@Name] && Date = "03.01"
    ).Value
)

 

Or(If you need to sum up Value)

 

AddColumns(
    TableB,
    "01.01",
    Sum(
        Filter(
            TableA,
            Name = TableB[@Name] && Date = "01.01"
        ),
        Value
    ),
    "02.01",
    Sum(
        Filter(
            TableA,
            Name = TableB[@Name] && Date = "02.01"
        ),
        Value
    ),
    "03.01",
    Sum(
        Filter(
            TableA,
            Name = TableB[@Name] && Date = "03.01"
        ),
        Value
    )
)

 

2.JPG

Best Regards,

Bof

View solution in original post

2 REPLIES 2
eka24
Super User
Super User

Try watching the video

https://youtu.be/EnBpWBb51hs?list=TLPQMjkwNzIwMjBWQhBpO5ffug&t=3

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

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.

v-bofeng-msft
Community Support
Community Support

Hi @Termigez1 :

Firstly,A gallery control can only achieve one level of nesting, that is to say, in a sub-gallery, you cannot nest another gallery.

Secondly,If you just want to display the data in the following format, I suggest you use the following method.

 01.0102.0103.01
Name 1123
Name 2 123
Name 3111

My data source:

1.JPG

Solution1:

1\Add a Gallery

Items:

 

TableB

 

2\Add a lable into this gallery

Text

 

ThisItem.Name

 

3\Add a sub-gallery into this gallery

Items

 

Filter(TableA,ThisItem.Name=Name)

 

Or(If you need to sum up Value)

 

AddColumns(GroupBy(Filter(TableA,ThisItem.Name=Name),"Date","TheGroup"),"Value",Sum(TheGroup,Value))

 

4\Add a label into this sub gallery

Text

 

ThisItem.Date

 

5\Add a label into this sub gallery

Text

 

ThisItem.Value

 

2.JPG

Solution2:

1\Add a datatable control and set it's items property to:

 

AddColumns(
    TableB,
    "01.01",
    LookUp(
        TableA,
        Name = TableB[@Name] && Date = "01.01"
    ).Value,
    "02.01",
    LookUp(
        TableA,
        Name = TableB[@Name] && Date = "02.01"
    ).Value,
    "03.01",
    LookUp(
        TableA,
        Name = TableB[@Name] && Date = "03.01"
    ).Value
)

 

Or(If you need to sum up Value)

 

AddColumns(
    TableB,
    "01.01",
    Sum(
        Filter(
            TableA,
            Name = TableB[@Name] && Date = "01.01"
        ),
        Value
    ),
    "02.01",
    Sum(
        Filter(
            TableA,
            Name = TableB[@Name] && Date = "02.01"
        ),
        Value
    ),
    "03.01",
    Sum(
        Filter(
            TableA,
            Name = TableB[@Name] && Date = "03.01"
        ),
        Value
    )
)

 

2.JPG

Best Regards,

Bof

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,337)