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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Mentzer
Frequent Visitor

Discovering the current liquid value of the tank based dates of liquid input and output

Hello people,

 

Let's suppose that I want to monitor the liquid level of 5 tanks - A, B, C, D and E, which have their capacities

Mentzer_0-1700145177935.png

 

We have a table (Liquid Input) for the amount of liquid injected into the tanks with the start and end date/time.

Mentzer_1-1700145318919.png

 

Then we have a table (Liquid Output) for the removal of liquid from each tank with the start and end date/time.

Mentzer_3-1700145572632.png

 

 

 

I would like a view of the current amount of liquid in each tank, like this:

Mentzer_4-1700145690522.png


Thus, I would like a visualization that shows the current amount of liquid in each tank to take into account the dates/time of liquid withdrawal, for example:
On the 20th we have 300L of liquid in Tank A. In the afternoon of the 21st, another 500L of liquid was placed in the tank. We have 800L so far. Arriving at night, they removed 300L, making the current volume of 500L.
Until the 23rd there was no liquid entry, but there was a 300L removal, making the new current volume of 200L.


And let's assume that the input and output tables are constantly updated.

 

 

Best Regards.

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Mentzer ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure.

Capacity = 
var _input=CALCULATE(SUM('Liquid Input'[Injected Liquid]),FILTER(ALL('Liquid Input'),'Liquid Input'[Tank]=MAX('Liquid Input'[Tank])))
var _output=CALCULATE(SUM('Liquid Output'[Removed Liquid]),FILTER(ALL('Liquid Output'),'Liquid Output'[Tank]=MAX('Liquid Input'[Tank])))
return _input-_output

(3) Then the result is as follows.

vtangjiemsft_1-1700463906129.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @Mentzer ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure.

Capacity = 
var _input=CALCULATE(SUM('Liquid Input'[Injected Liquid]),FILTER(ALL('Liquid Input'),'Liquid Input'[Tank]=MAX('Liquid Input'[Tank])))
var _output=CALCULATE(SUM('Liquid Output'[Removed Liquid]),FILTER(ALL('Liquid Output'),'Liquid Output'[Tank]=MAX('Liquid Input'[Tank])))
return _input-_output

(3) Then the result is as follows.

vtangjiemsft_1-1700463906129.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Rupak_bi
Post Prodigy
Post Prodigy

Hi, 

this can be done by union both the table and based on "conclution date", input as (+) value and output as (-) value , tank name.  if you still feel it difficult, share these tables so that I can copy those values.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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