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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

Finance Returns Calculation - DAX

Hi, 

I am trying to calculate and visualize cummulative returns for Funds (Ex: S&P 500). 

I have daily performance data for the fund. 

 

Desired Output:

Making the measure dynamically start from 0% for the selected date range and then calculate returns from there. 

Example: 

Desired Op.PNG

 

Challenge/Issue: 

 

I would greatly appreceate any help in making the calculation start from 0 for any selected date range. 

This is where I am at currently:

 

Return = 
CALCULATE(
    PRODUCTX(Table, 1 + (Table[DataPointValue]/100))
   , FILTER(ALLSELECTED(Table[AsOfDate]),  ISONORAFTER(Table[AsOfDate], MAX(Table[AsOfDate]), DESC)
    )) - 1

 

 

Sample Data: 

AsOfDateFundDaily Performance
4/28/2020 0:00S&P 500 Index-0.52%
4/27/2020 0:00S&P 500 Index1.47%
4/24/2020 0:00S&P 500 Index1.39%
4/23/2020 0:00S&P 500 Index-0.05%
4/22/2020 0:00S&P 500 Index2.30%
4/21/2020 0:00S&P 500 Index-3.07%
4/20/2020 0:00S&P 500 Index-1.79%
4/17/2020 0:00S&P 500 Index2.68%
4/16/2020 0:00S&P 500 Index0.58%
4/15/2020 0:00S&P 500 Index-2.20%
4/14/2020 0:00S&P 500 Index3.07%
4/13/2020 0:00S&P 500 Index-1.01%
4/9/2020 0:00S&P 500 Index1.46%
4/8/2020 0:00S&P 500 Index3.43%
4/7/2020 0:00S&P 500 Index-0.16%
4/6/2020 0:00S&P 500 Index7.03%
4/3/2020 0:00S&P 500 Index-1.50%
4/2/2020 0:00S&P 500 Index2.30%
4/1/2020 0:00S&P 500 Index-4.41%
3/31/2020 0:00S&P 500 Index-1.59%
3/30/2020 0:00S&P 500 Index3.37%
3/27/2020 0:00S&P 500 Index-3.37%
3/26/2020 0:00S&P 500 Index6.25%
3/25/2020 0:00S&P 500 Index1.15%
3/24/2020 0:00S&P 500 Index9.39%
3/23/2020 0:00S&P 500 Index-2.93%
3/20/2020 0:00S&P 500 Index-4.32%
3/19/2020 0:00S&P 500 Index0.48%
3/18/2020 0:00S&P 500 Index-5.18%
3/17/2020 0:00S&P 500 Index6.00%
3/16/2020 0:00S&P 500 Index-11.98%

 

Thanks!

 

 

 

 

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , when every you do such calculation use date table

Return = 
CALCULATE(
    PRODUCTX(Table, 1 + (Table[DataPointValue]/100))
   , FILTER(ALLSELECTED(DATE[AsOfDate]),  ISONORAFTER(DATE[DATE], MAX(DATE[DATE]), DESC)
    )) - 1

 

I used like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=max(Sales[Sales Date])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 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.

October NL Carousel

Fabric Community Update - October 2024

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