cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

New Member

## Cumulative Sum of Another Measure

I have a small task that I find hard to accomplish as I always find DAX so difficult. I need to create measure to calculate the cumulative sum of another measure. For example,

The column Cumulative Sum of "Sales Check" is what I am looking for, so I can tell November is the 6th month in the 2009 year that had the cumulative sales greater than \$25M. I hope someone can please show me a solution.

1 ACCEPTED SOLUTION
Super User

hi, @mybarbie9917_LI

try below

``````sales cumulative =
calculate(
sumx('tablename',[sales check]),
filter(
all('d_date'),
'd_date'[month]<= max('d_date'[month])&&
d_date'[year]=max(d_date'[year])
)
)``````
3 REPLIES 3
Super User

hi, @mybarbie9917_LI

try below

``````sales cumulative =
calculate(
sumx('tablename',[sales check]),
filter(
all('d_date'),
'd_date'[month]<= max('d_date'[month])&&
d_date'[year]=max(d_date'[year])
)
)``````
Super User

HI, @mybarbie9917_LI

if you want to use MEASURE  inside sum use sumx() instead of sum()
try below

``````sales cumulative =
calculate(
sumx('tablename',[sales amount]),
filter(
all('d_date'),
'd_date'[Date]< max('d_date'[Date])
)
)``````
New Member

Thanks for your reply, but it is not exactly what I am looking for. I already have the Sales Cumulative measure. I want to have measure that can do the cumulative sum from the result of the measure Sales Check.

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors