Forum Discussion
Anonymous
4 years agoNot applicable
Calculated average value isnt correct
H2SO4 mg/l = VAR H2SO4_apl = CALCULATE ( SUMX ( ImportOfLIMS, ImportOfLIMS[H2SO4] ), ImportOfLIMS[SAMPLE_GROUP_NAME] = "Acid Plant" ) VAR isblankH2SO4 = IF ( ...
- Anonymous4 years ago
Anonymous , that's interesting. Try adding some more debug code. I'm interested to see if the two methods you use to refer to [H2SO4 kg/d] give the same result.
VAR H2SO4measure = [H2SO4 kg/d] VAR H2SO4column = CALCULATE ( SUMX ( ImportOfLIMS, 'ImportOfLIMS'[H2SO4 kg/d] ) ) VAR Bleed = [APL Bleed m3/day] VAR H2SO4mg = [H2SO4 mg/l] RETURN FORMAT(MINX(MostRecentDates, [Date]), "YYYYMMDD") & " ; " & FORMAT(MAXX(MostRecentDates, [Date]), "YYYYMMDD") & " ; " & MINX(MostRecentDates, [@H2SO4]) & " ; " & MAXX(MostRecentDates, [@H2SO4]) & " ; " & FORMAT(Result, "0.00") & " ; " & FORMAT(H2SO4measure, "0.00") & " ; " & FORMAT(Bleed, "0.00") & " ; " & FORMAT(H2SO4mg, "0.00")If 'ImportOfLIMS'[H2SO4 kg/d] is actually a measure and not a column, then I believe you can change the [Avg_10_H2SO4_(kg/d)] to refer to it like this below. ADDCOLUMNS is an iterator and will calculate the expression for "@H2SO4" for every row in the AllDatesPrior table variable, so there is no need for a SUMX or CALCULATE.
VAR AllDates_H2SO4 = ADDCOLUMNS ( AllDatesPrior, //"@H2SO4", CALCULATE ( SUMX ( ImportOfLIMS, 'ImportOfLIMS'[H2SO4 kg/d] ) ) "@H2SO4", [H2SO4 kg/d] )Incidentally, from the raw data, what actually is the correct result for 21 Jun?
Anonymous
4 years agoNot applicable
I changed the:
H2SO4 kg/d =
CALCULATE([H2SO4 mg/l]*[APL Bleed m3/day])
INTO
INTO
H2SO4 kg/d =
SUMX(ImportOfLIMS, ImportOfLIMS[H2SO4 mg/l]*[APL Bleed m3/day])
Output is now the same as the avg= 2595. how can that be if on 21st june : [H2SO4 mg/l] = 82,30 AND BLEED IS 30,03
82.30*30 IS 2471...
Output is now the same as the avg= 2595. how can that be if on 21st june : [H2SO4 mg/l] = 82,30 AND BLEED IS 30,03
82.30*30 IS 2471...