This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
May I ask you if there is a possible way to do the same but for the decrease?
If the code appears today but no longer tomorrow I want it to reflect it as a negative.
Here I attached an example:
For example the code 888890 had value 72 for March 2nd, but it didn't have any values on March 3rd So i want the measure to return a -72 On March 3rd. An d the same case for March 4th and 5th returning a -125. So that the measure now instead of giving me the total sum for thos positive values I want it to give me only the sum for the negative ones.
Hope this is possible!
Thanks in advance.
Solved! Go to Solution.
Hi,
According to your description, Please try this measure:
Measure =
VAR a =
CALCULATE (
SUM ( 'Table'[Values] ),
FILTER (
ALLSELECTED ( 'Table'[Date] ),
'Table'[Date]
= CALCULATE (
MAX ( 'Table'[Date] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] < MIN ( 'Table'[Date] )
&& 'Table'[Date Code] IN DISTINCT ( 'Table'[Date Code] )
)
)
)
)
RETURN
IF (
a = BLANK (),
IF ( MAX ( 'Table'[Values] ) = BLANK (), BLANK (), 0 ),
SUM ( 'Table'[Values] ) - a
)The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hi,
According to your description, Please try this measure:
Measure =
VAR a =
CALCULATE (
SUM ( 'Table'[Values] ),
FILTER (
ALLSELECTED ( 'Table'[Date] ),
'Table'[Date]
= CALCULATE (
MAX ( 'Table'[Date] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Date] < MIN ( 'Table'[Date] )
&& 'Table'[Date Code] IN DISTINCT ( 'Table'[Date Code] )
)
)
)
)
RETURN
IF (
a = BLANK (),
IF ( MAX ( 'Table'[Values] ) = BLANK (), BLANK (), 0 ),
SUM ( 'Table'[Values] ) - a
)The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 25 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 28 | |
| 23 | |
| 23 |