I HAVE A GALLERY WITH ITEMS PROPERTY WITH THE FOLLOWING
FirstN(
LastN(
Distinct(
Filter(
'Impact & Assessment Evaluations',
'Top IT Risk _Category '.Risk_name = VarTopItForBottomUp.Risk_name
),
Question
),
CountRows(
Distinct(
Filter(
'Impact & Assessment Evaluations',
'Top IT Risk _Category '.Risk_name = VarTopItForBottomUp.Risk_name
),
Question
)
) - (varCurrentPage - 1) * 4
),
4
)
I have a next button which is outside the gallery, when user clicks on it, the next four items will display
If(
varCurrentPage < RoundUp(
CountRows(
Distinct(
Filter('Impact & Assessment Evaluations','Top IT Risk _Category '.Risk_name = VarTopItForBottomUp.Risk_name
),
Question
)
) / 4,
0
),
Set(varCurrentPage, varCurrentPage + 1)
)
I have a previous button which is outside the gallery, when user clicks on it, the previous four items will display
If(
varCurrentPage > 1,
Set(
varCurrentPage,
varCurrentPage - 1
)
)
I have a label which is inside the gallery the gallery which shows the value of the impact
I have another label which is outside the gallery which shows the sum of values inside the gallery Label
Sum(
ForAll(
Gallery4.AllItems,
Value(Label5.Text)
),
Value
)
The problem Iam facing is when clicks on the next button the count of the sum which is done for the first 4 items is gone
and starting from the default as Zero
the sum resetting when navigating through pages in My gallery. the fact that the Sum function in PowerApps recalculates based on the currently visible items in the gallery. When you change pages, the visible items change, which resets the sum.
Could anyone please help me to fix the issue