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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

How to use Rolling 12 month with Sum DAX and ifs DAX

Hi,

Can anyone help me here 

i have 3 table Master, FY2324 and FY2425, 

i used Append function and merged FY2324 and FY2425, in Master , here i need to use Rolling12 month

(RAG12Month = CALCULATE(SUM(Customer[Achievement]),DATESINPERIOD(Customer[Dated], MAX(Customer[Dated]), -12, MONTH)))
Sudhakar1000_0-1721735707876.png

  So now i need to sum based on NewCRMID the below image 4 id will be there Ie. 

 

NEW CRM IDSBUDatedAchievementRAGTOTALVal (Rolling 12 month) 
3871   340380 
3871PWR20-04-20236467340380Blue will get filter bcz its will excited 12 month
3871PWR15-11-2023230380340380 
3871SECS09-05-2024110000340380 

 

 

and then i have to 

1. Rolling 12 month.

2. based on the NEW CRM ID, get the Values

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Thanks @Greg_Deckler  for the quick reply and solution. Allow me to offer some other insights:

You can create a column.

RAGTOTALVal (Rolling 12 month) = var _a=CALCULATE(SUM(Customer[Achievement]),FILTER('Customer',[NEW CRM ID]=EARLIER('Customer'[NEW CRM ID])))
RETURN CALCULATE(_a,DATESINPERIOD(Customer[Dated], MAX(Customer[Dated]), -12, MONTH))

Then the result is as follows.

vtangjiemsft_0-1721892378890.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Anonymous
Not applicable

Hi Tangjie, 

i'm getting the below error

The MAX function only accepts a column reference as an argument.

Anonymous
Not applicable

Hi @Anonymous ,

 

Are you creating a calculated column?

vtangjiemsft_0-1721899863827.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Anonymous
Not applicable

Yes Tangjie

Anonymous
Not applicable

Hi @Anonymous ,

 

Under my tests it worked fine. Can you provide a PBIX file (please be careful to protect private data).

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Neeko Tang

Greg_Deckler
Community Champion
Community Champion

@Anonymous Try this: Better Rolling Average - Microsoft Fabric Community Just replace AVERAGEX with SUMX



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors
Top Kudoed Authors