Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
76 | |
63 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
64 | |
59 | |
56 |