Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
lac
New Member

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.

 

lac_0-1648189220435.pnglac_2-1648189319520.png

 

 

 

 

 

 

 

 

 

 

 

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 2
PaulDBrown
Community Champion
Community Champion

Please share sample non-confidential data





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






ghoshabhijeet
Solution Supplier
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?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.