Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
JL0101
Helper II
Helper II

Subtracting 2 columns in a matrix with a measure and filter

How woud I subtract 2 columns both caluculating volume from the same column but at different dates. The following code below works, however I can't get the volumes to filter on a specifc date. I.E I want to do the calculation 

 

Volume(@Datepicker1) + Volume(@Datepicker2)

 

Datepicker1 & Datepicker2Volume(@Datepicker1)Volume(@Datepicker2)Volume(@Datepicker1 = 09/01/23) - Volume(@Datepicker2 = 01/01/23 )
01/01/2023
01/01/2023
01/01/2023
01/01/2023
01/01/2023
01/01/2023
01/01/2023
01/01/2023
09/01/2023
09/01/2023
09/01/2023
09/01/2023
09/01/2023
09/01/2023
09/01/2023
09/01/2023
09/01/2023
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
0
0
0
0
0
0
0
19

 

 

Datepicker_Test =

var Datepicker1 = SELECTEDVALUE(DateSprints[DatePicker1])
var Datepicker2 = SELECTEDVALUE(DateSprints[DatePicker2])

RETURN
 
CALCULATE(
SUM('SummaryFosAll'[Volume (M3)])-SUM('SummaryFosAll'[Volume (M3)]))
 
I tried 
 --------------------------------------------------------------------------------------------------
Datepicker_Test =

var Datepicker1 = SELECTEDVALUE(DateSprints[DatePicker1])
var Datepicker2 = SELECTEDVALUE(DateSprints[DatePicker2])

RETURN

CALCULATE(
SUM('SummaryFosAll'[Volume (M3)]), FILTER(ADDCOLUMNS(SummaryFosAll[Volume (M3)],DateSprints[DatePicker1]=Datepicker1))-SUM('SummaryFosAll'[Volume (M3)]))

 
 
----------------------------------------------------------------------------------------------------------
 
But I get an error
0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.