Skip to main content
cancel
Showing results for 
Search instead 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.

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
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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