Trouble dividing a number and duration

Hi all,

Having trouble here, I'm trying to get de amount (kilograms) fed per day. I'm trying with this formula.

[_THISROW].[Total Alimento Consumido]/(TOTALHOURS(TODAY()-MAX(SELECT(Inicios Tanques[Fecha],AND([IdTanque]=[_THISROW].[IdTanque],[Tipo]="Inicio"))))/24)

the max(select)) expression is ok, i'm using it in another column.

 

thank u in advance

Solved Solved
0 6 130
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4
6 REPLIES 6

Could you please mention what issue you are facing?

Just as a guess you are probably facing an issue of number division?

Could you please try an expression

[_THISROW].[Total Alimento Consumido]/((TOTALHOURS(TODAY()-MAX(SELECT(Inicios Tanques[Fecha],AND([IdTanque]=[_THISROW].[IdTanque],[Tipo]="Inicio"))))/24)*1.00)

or the following

[Total Alimento Consumido]/((TOTALHOURS(TODAY()-MAX(SELECT(Inicios Tanques[Fecha],AND([IdTanque]=[_THISROW].[IdTanque],[Tipo]="Inicio"))))/24)*1.00)

Please ensure the column type is decimal if you are using this expression in a column.

Thank you for your answer,

yes the column type is decimal and the result of this expression returns 0.

Thank you. Did you try the suggested expression? 

yes I did, same problem.

Thank you very much for your help!

Could you share the test results expanded?

An exactly similar expression works in testing.

You could analyze at what step your expression is failing. You could verify aspects such as is the numerator too small compared to denominator, thereby giving a near zero result and are the decimal digits set less that the decimal digits in the result?

Suvrutt_Gurjar_0-1651463310442.png

 

Steve
Platinum 4
Platinum 4
Top Labels in this Space