Forum Discussion
kpct56591
1 year agoFrequent Visitor
Difference between two years showing under both years
Hello, I am trying to have a matrix that displays the YOY difference in quantity shipped. I have a measure that does that, but it displays under both years. How can I remove it from 2023? ...
- 1 year ago
Hi kpct56591 ,
Try out this below measure
ShipQtyDiffFrom2023 =
VAR ThisYear = SELECTEDVALUE('ofrordx'[Ship Date].[Year])
VAR CurrentQty = SUM('ofrordx'[Ship Qty])
VAR BaseQty2023 =
CALCULATE(
SUM('ofrordx'[Ship Qty]),
'ofrordx'[Ship Date].[Year] = 2023
)
RETURN
IF(
ThisYear > 2023 &&
NOT ISBLANK(BaseQty2023) &&
NOT ISBLANK(CurrentQty),
CurrentQty - BaseQty2023
)
v-echaithra
Community Support
1 year agoHi kpct56591 ,
Try out this below measure
ShipQtyDiffFrom2023 =
VAR ThisYear = SELECTEDVALUE('ofrordx'[Ship Date].[Year])
VAR CurrentQty = SUM('ofrordx'[Ship Qty])
VAR BaseQty2023 =
CALCULATE(
SUM('ofrordx'[Ship Qty]),
'ofrordx'[Ship Date].[Year] = 2023
)
RETURN
IF(
ThisYear > 2023 &&
NOT ISBLANK(BaseQty2023) &&
NOT ISBLANK(CurrentQty),
CurrentQty - BaseQty2023
)