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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Chennaiah
Frequent Visitor

Last 5 Years running total

 

I have below data , want show running headcount for last 5 years.

 

YearHeadcount
2010100
2011200
2012300
2013400
2014500
2015600
2016700
2017800
2018900

 

Output :

YearRunning Headcount
2010 
2011 
2012 
2013 
20141500
20152100
20162800
20173600
20184500
2 ACCEPTED SOLUTIONS
v-qiuyu-msft
Community Support
Community Support

Hi @Chennaiah,

 

You can create a measure below: 

 

Running Headcount = var LY=MAXX(ALL(Table1),'Table1'[Year])
return
IF(MAX(Table1[Year])<=LY-5,BLANK(),CALCULATE(SUM(Table1[Headcount]),FILTER(ALL(Table1),Table1[Year]<=MAX(Table1[Year]))))

 

q4.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @Chennaiah,

 

You can create a measure below: 

 

Running Headcount = var LY=MAXX(ALL(Table1),'Table1'[Year])
return
IF(MAX(Table1[Year])<=LY-5,BLANK(),CALCULATE(SUM(Table1[Headcount]),FILTER(ALL(Table1),Table1[Year]<=MAX(Table1[Year]))))

 

q4.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-qiuyu-msft

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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