cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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
Super User III
Super User III

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

Community Support
Community Support

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.

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (12,146)