
Announcements
Hi there,
I am fairly new to Power Apps, and here's what I am trying to do.
I have two SharePoint lists as follows.
Table 1
| Region | Country | Area |
| Region A | Country 1 | Area I |
| Region A | Country 1 | Area II |
| Region A | Country 2 | Area III |
| Region B | Country 3 | Area IV |
| Region B | Country 4 | Area V |
| Region B | Country 4 | Area V |
Table 2
| Name | Country | Area |
| Aaron | Country 1 | Area I |
| Ben | Country 1 | Area II |
| Collin | Country 2 | Area III |
| Daniel | Country 3 | Area IV |
| Edward | Country 3 | Area IV |
| Fernald | Country 1 | Area I |
(Both tables' cell value are text value)
I am trying to create a bar graph to show the counts of Area on table 2, but I also want to show the zero values (Area V) on the axis. Is there any way I can pull out the data from Table 1 as the x-axis label?
Thanks
Hi@ryannghk,
Based on the issue that you mentioned, do you want to display the counts of the Area?
Currently, the configuration of your table is not suitable for populating the bar chart. You should reconstruct the table.
I have a test on my side, please take a try as below:
Add a Button and set the OnSelect property as below:
Collect(
ColChart,
Table(
{
AreaType: "Area I",
CountArea: CountIf(
Table2,
Area = "Area I"
)
},
{
AreaType: "Area II",
CountArea: CountIf(
Table2,
Area = "Area II"
)
},
{
AreaType: "Area III",
CountArea: CountIf(
Table2,
Area = "Area III"
)
},
{
AreaType: "Area IV",
CountArea: CountIf(
Table2,
Area = "Area IV"
)
},
{
AreaType: "Area V",
CountArea: CountIf(
Table2,
Area = "Area V"
)
}
)
)
Add a Column Chart and set the Items property of the ColumnChart1 as below:
ColChart
Set the Items property of the Legend1as below:
ColChart.CountArea
Copy the Legend control and set the Items property of the Legend1_1 as below:
ColChart.AreaType
Best Regards,
Qi