Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I've seen quite a lot of suggestions using the below approach on the internet, also on Microsoft's site - however, when I'm attempting to insert a custom column in a table to sum values across a period of time, it's only returning the value of the current row (can be seen in image further down). Here's the snippet used:
value sum = CALCULATE (
SUM ('Table'[Value]);
DATESBETWEEN ('Table'[Date]; DATE (2019;1;1); DATE (2019;1;30))
)I have a table called "Table" (surprise) and inserted the above snippet. The result is as below:
I've seen multiple sites stating taht this should SUM the values inbetween the dates, but for whatever reason I can't make it work? I've checked that there are no relations between the table in question and any others.
Am I missing something or
Solved! Go to Solution.
Hi @Anonymous ,
You dax is correct but it should be a measure. If you want use calculated column to show the sum, you can refer to the following dax:
Column =
CALCULATE (
SUM ( 'Table'[Value] ),
DATESBETWEEN ( 'Table'[Date], DATE ( 2019, 01, 01 ), DATE ( 2019, 01, 31 ) ),
ALL ( 'Table' )
)
or
Column 2 =
SUMX (
FILTER (
'Table',
'Table'[Date] >= DATE ( 2019, 01, 01 )
&& 'Table'[Date] <= DATE ( 2019, 01, 31 )
),
'Table'[Value]
)
Here is the result.
The difference between measure and calculated column can be found in this link:
https://community.powerbi.com/t5/Desktop/column-vs-measure/td-p/13201
Hi @Anonymous ,
You dax is correct but it should be a measure. If you want use calculated column to show the sum, you can refer to the following dax:
Column =
CALCULATE (
SUM ( 'Table'[Value] ),
DATESBETWEEN ( 'Table'[Date], DATE ( 2019, 01, 01 ), DATE ( 2019, 01, 31 ) ),
ALL ( 'Table' )
)
or
Column 2 =
SUMX (
FILTER (
'Table',
'Table'[Date] >= DATE ( 2019, 01, 01 )
&& 'Table'[Date] <= DATE ( 2019, 01, 31 )
),
'Table'[Value]
)
Here is the result.
The difference between measure and calculated column can be found in this link:
https://community.powerbi.com/t5/Desktop/column-vs-measure/td-p/13201
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.