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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX. SUM of Value based on previous rows filtered by indicators

Hi,

I am unable to think of a DAX, that would add value from different row in same table based on date and identicator (Previous month needed)

ArtursM_0-1659445984877.png

I need to add value from previous month to the row for next month. 

I tried: 

= Calculate( SUM(Value), Filter( ALLEXCEPT(Table,Name), Date= Date previous month))
Date previous month is calculated with:
= PREVIOUSMONTH(Date)
The DAX needs to take only value from previous month. In data I have a large data size, so there are hundreds of names and several years of data.
 
This give me only blanks with no errors. 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Found a solution:

VAR Previous_Month = DATEADD(Date,-1,MONTH)

return CalculateSUM(Value), FilterALLEXCEPT(Table,Name), DatePrevious_Month))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Found a solution:

VAR Previous_Month = DATEADD(Date,-1,MONTH)

return CalculateSUM(Value), FilterALLEXCEPT(Table,Name), DatePrevious_Month))

amitchandak
Super User
Super User

@Anonymous , if have date, then create a date table you can try like

 

Calculate( SUM(Value),PREVIOUSMONTH(Date[Date]) )

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.