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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
ak77
Post Patron
Post Patron

Row Count for Annualized (rolling) returns

Hi All,

Thanks for all help for my queries till date.

Please advise on the below Issue.

 

I have a big data set for multiple portfolio's starting from year 2010 . i am calculating rolling returns from 1 - 10 years based on user selected date as below.for some portfolio, the data is monthly wise(12 per year) and some portfolio are daily wise(365 per year).  

 

DAX used for Ex for 2 year: 2 year=CALCULATE(SUM ( Client_Returns_Data[Returns]),DATESINPERIOD('Date Table'[_Date], [_Start_Date], -2,YEAR))

 

Now the issue is, i  want to check the row count and then calculate the annualized year. for 2 year for a selected date..

i have to check if its year wise or day wise count for each year.

 

How to put condition to the DAX formula to check this rowcount? please help.

 

 

 

 

ak77_1-1695950035489.png

 

 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@ak77 , based on what I got

 

Anualized =
var _sum = CALCULATE(SUM ( Client_Returns_Data[Returns]),DATESINPERIOD('Date Table'[_Date], [_Start_Date], -2,YEAR))
var _date= CALCULATE(Distinctcount ( Client_Returns_Data[retur_date]),DATESINPERIOD('Date Table'[_Date], [_Start_Date], -2,YEAR))
return
divide(_sum, _date)*365

 

 

or

 

CALCULATE(Averagex(Values('Date Table'), CALCULATE(SUM ( Client_Returns_Data[Returns]))),DATESINPERIOD('Date Table'[_Date], [_Start_Date], -2,YEAR))

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

Thanks @amitchandak . wil try.

 

have a question: is there a way to check  if data is avaialble for the full year before calculating this ?

 

 CALCULATE(SUM ( Client_Returns_Data[Returns]))),DATESINPERIOD('Date Table'[_Date], [_Start_Date], -2,YEAR))

Hi @amitchandak ,

Need a help,for one client i have both montlhy and daily data , Monthly data till  <2021 and Daily Data from 2021

 

for Effective date 31/12/2022 , i need to check row count as below for each year and then calculate if rowcounts are satisifed... how to get this.. can u please check and help

 

YearRowcount
1 year- 2022365
2 year 2022,2021365+ 12
3 year 2022,2021,2020365+ 12 +12

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.