cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Avoid circular reference on calculated field

Hello 

I have a calculated field: Sum(Gallery1.AllItems, HOURS).

I would like to show the result on a different screen, but duplicating it gives a circular ref warning.

How can I convert a calculation value to a text label?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Avoid circular reference on calculated field

OnVisible of the Current screen where you have the Gallery, put this variable:
Set(MyCalFigure,Sum(Gallery1.AllItems, HOURS))
Insert another label in the screen2 and put the Variable on the Text property:
MyCalFigure

View solution in original post

3 REPLIES 3
Highlighted
Community Champion
Community Champion

Re: Avoid circular reference on calculated field

OnVisible of the Current screen where you have the Gallery, put this variable:
Set(MyCalFigure,Sum(Gallery1.AllItems, HOURS))
Insert another label in the screen2 and put the Variable on the Text property:
MyCalFigure

View solution in original post

Highlighted
Community Support
Community Support

Re: Avoid circular reference on calculated field

Hi @Englishweb ,

Do you want to use the result of "Sum(Gallery1.AllItems, HOURS)" in multiple screens?

I suggest you save this formula's result as a variable.

Then use the variable in multiple screens, for example, display in a text label.

Could you tell me the formula in Gallery1's Items property?

If the items in gallery1 will not change, you could directly set the screen's OnVisible that has gallery1:

Set(var,Sum(Gallery1.AllItems, HOURS)

 If the items in gallery1 will change based on a button or a drop down, you need to set the button's OnSelect or the drop down's OnChange to this formula:

Set(var,Sum(Gallery1.AllItems, HOURS)

 Then, set the label's Text:

var

The label will display the calculated result, no matter in which screen.

 

 

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.
Highlighted
Post Patron
Post Patron

Re: Avoid circular reference on calculated field

Hello @v-yutliu-msft @eka24 

Thank you both for your help.

The Set variable works, but the value is the same for each record in the 2nd Gallery. 

How do I combine a variable with ThisItem,Student1 to get individual results for each record? At the moment it just displays the last value recorded.

calculate hours.jpg

The filter for the Calculation Gallery is:

Filter(DFTCURRENTHRS;TutorSurname = LabelTutorNameSurname.Text

The calculation field is: Sum(GalleryCurrentHrs1.AllItems; HOURS)

Hope you can help!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,503)