Cumulative Sales

Hi all, on my cumulative sales it leverages a switch, whenever the switch is true for minus Source deductions, the values repeat 30,117.72 from 12/12/2019 onwards, any idea how I can remedy this?

Cumulative Sales =
IF(ISBLANK([Sales]),
BLANK(),
CALCULATE([Sales],
FILTER(ALLSELECTED(Dates),
Dates[Date]<=MAX(Dates[Date]))))

SWITCH(TRUE(),
VALUES(‘Metric Selection’[Metric])=“Total Sales”,[Total Sales],
VALUES(‘Metric Selection’[Metric])=“Total Sales - Source Costs”,[Total Sales]-[Source Deductions],

image

Please post a sample PBIX file so we can better assist.

Thanks
Enterprise%20DNA%20Expert%20-%20Small

Managed to resolve myself, thank you

Sales =
SWITCH(TRUE(),
VALUES(‘Metric Selection’[Metric])=“Total Sales”,[Total Sales],
VALUES(‘Metric Selection’[Metric])=“Total Sales - Source Costs”,
IF(ISBLANK([Total Sales]),
BLANK(),
[Total Sales]-[Source Deductions]))

1 Like

You can also try using SELECTEDVALUE instead of VALUES.

Thanks
Enterprise%20DNA%20Expert%20-%20Small