Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 10 |