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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.