The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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! 🙂
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
14 | |
11 | |
10 | |
9 |