Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Community,
I have a level transmitter that transmits the level-difference in a tank for each day:
Date | Amount (m3) |
2022-08-01 | -15 |
2022-08-02 | 0 |
2022-08-03 | 315 |
2022-08-04 | -18 |
I have made a DAX meassure code [Level in Tank] that estimates the level based on this (estimating that we started with 100 m3):
Date | Amount (m3) |
2022-08-01 | 85 |
2022-08-02 | 85 |
2022-08-03 | 400 |
2022-08-04 | 382 |
My issue is that I want to be able to filter out the repeated 85 value occuring the 2022-08-02 so that the following result can be obtained:
Date | Amount (m3) |
2022-08-01 | 85 |
2022-08-03 | 400 |
2022-08-04 | 382 |
Is there anybody who can help me with this?
Br
Solved! Go to Solution.
Hi @Mr_Circ ,
I suggest you to try IF() function in your code.
M_Amount (m3) =
VAR _START = 100
VAR _RUNNING_TOTAL =
CALCULATE (
SUM ( 'Table'[Amount (m3)] ),
FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
)
RETURN
IF ( SUM ( 'Table'[Amount (m3)] ) <> 0, _START + _RUNNING_TOTAL, BLANK () )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Mr_Circ ,
I suggest you to try IF() function in your code.
M_Amount (m3) =
VAR _START = 100
VAR _RUNNING_TOTAL =
CALCULATE (
SUM ( 'Table'[Amount (m3)] ),
FILTER ( ALL ( 'Table' ), 'Table'[Date] <= MAX ( 'Table'[Date] ) )
)
RETURN
IF ( SUM ( 'Table'[Amount (m3)] ) <> 0, _START + _RUNNING_TOTAL, BLANK () )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much Mr. Zhou.
This did the trick! 🙂
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |