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
rmalhan12
Frequent Visitor

12 Month Total by Client based on Report Date

rmalhan12_0-1673281059278.png

I have the table above which lists the monthly income by month by client. I wanted to insert another column which would add the 12 month total income per client based on the report date and the client ID.

 

I have tried to use the formula below but to no success as it gives me the total value for all clients on each line.

 

12MonthRI =
VAR _MAX = EOMONTH(IncomeSummary[ReportDate],0)
VAR _MIN = EOMONTH(IncomeSummary[ReportDate],-12)+1
return
SUMX(FILTER(IncomeSummary,IncomeSummary[ClientId] && IncomeSummary[ReportDate] <= _MAX && IncomeSummary[ReportDate] >= _MIN),IncomeSummary[GrossFCI])
 
Any help is appreciated or even a different way of getting the correct figure. 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@rmalhan12 , for new column try like

12MonthRI =
VAR _MAX = EOMONTH(IncomeSummary[ReportDate],0)
VAR _MIN = EOMONTH(IncomeSummary[ReportDate],-12)+1
return
SUMX(FILTER(IncomeSummary,IncomeSummary[ClientId] =earlier(IncomeSummary[ClientId] ) && IncomeSummary[ReportDate] <= _MAX && IncomeSummary[ReportDate] >= _MIN),IncomeSummary[GrossFCI])

 

 

For measures

try like

examples

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

 

Try new DAX function

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

 

 

Rolling Months Formula: https://youtu.be/GS5O4G81fww

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@rmalhan12 , for new column try like

12MonthRI =
VAR _MAX = EOMONTH(IncomeSummary[ReportDate],0)
VAR _MIN = EOMONTH(IncomeSummary[ReportDate],-12)+1
return
SUMX(FILTER(IncomeSummary,IncomeSummary[ClientId] =earlier(IncomeSummary[ClientId] ) && IncomeSummary[ReportDate] <= _MAX && IncomeSummary[ReportDate] >= _MIN),IncomeSummary[GrossFCI])

 

 

For measures

try like

examples

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

 

Try new DAX function

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

 

 

Rolling Months Formula: https://youtu.be/GS5O4G81fww

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.

Top Solution Authors
Top Kudoed Authors