Forum Discussion

lac's avatar
lac
New Member
4 years ago

Problems with calculating values

Hello! I don't know how to get the correct number from a table.

 

I need to add and substract several values from a table depending on several conditions. Some conditions are that metertagids have to be 1898,1890,1902,2275 and 463. Also they have to be calculated in the same time period, so for each calculation timestamputc has to be the same.

 

My table is like this where the are several metertagid. So I need to do some calculations where the values are stored in the data column.

 

 

 

 

 

 

 

 

 

 

 

 

I prefer to do it in a measure format, but if its not possible it will also work adding a new column to the table.

 

My acutal code is this:

 

C_Agua_Coccion = CALCULATE(SELECTEDVALUE(DataLog[Data]),DataLog[MeterTagId]=1898) - CALCULATE(SELECTEDVALUE(DataLog[Data]),DataLog[MeterTagId]=1890) - CALCULATE(SELECTEDVALUE(DataLog[Data]),DataLog[MeterTagId]=1902) + CALCULATE(SELECTEDVALUE(DataLog[Data]),DataLog[MeterTagId]=2275) + CALCULATE(SELECTEDVALUE(DataLog[Data]),DataLog[MeterTagId]=463)
 
Thanks in advance.

2 Replies

  • ghoshabhijeet's avatar
    ghoshabhijeet
    Solution Supplier

    lacYour requirement is not very clear. As mentioned, you have to add and subtract several values from the table based on some condition. Can you please elaborate?