Hi
I have a gallery with different data labels that will contain a value.
I asked copilot to assist in working out how to count how many of these labels contain data as that count will then be used to divide the total sum of these data labels and get the average.
However, I am getting an error on the code that was generated and I am struggling to understand what is wrong and how I can fix it.
Below is the code I was given by copilot and the red is obviously the error
There are 10 data labels that contain the values of text inputs where the decimals were converted to seconds. Then what is supposed to happen is that depending on how many cycles have been done I need to divide the sum of the cycles by the number of data labels that are not blank in order to get an average.
- !Blank(Value) OR !Blank(Result) still give an error
Here is the actual code
With(
{
DataLabels: [lbl_Cycle1_Sec.Text, lbl_Cycle2_Sec.Text, lbl_Cycle3_Sec.Text, lbl_Cycle4_Sec.Text, lbl_Cycle5_Sec.Text, lbl_Cycle6_Sec.Text, lbl_Cycle7_Sec.Text, lbl_Cycle8_Sec.Text, lbl_Cycle9_Sec.Text, lbl_Cycle10_Sec.Text],
NonEmptyLabels: Filter(DataLabels, !Blank(Value)),
Count: CountRows(NonEmptyLabels)
},
Value(lbl_OT.Text) / Count
)