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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
kar2022
Frequent Visitor

Monthly percentage rolling return

Hi,

I have a Merge Table with multiple players and one Leader.  I want to calculate the total monthly Gain (or loss) on a rolling basis. and compare side-by-side for each player with the leader.   If possible, I would like to forcast Player's and Leader's performance based on the "Forecast" tool.    I can also separate as PlayerA and Leader.

 

DatePlayerGains DatePlayerGains
12/1/20PlayerA4.21% 12/1/20Leader3.71%
1/1/21PlayerA0.65% 1/1/21Leader-1.11%
2/1/21PlayerA1.87% 2/1/21Leader2.61%
3/1/21PlayerA0.48% 3/1/21Leader4.24%
4/1/21PlayerA3.18% 4/1/21Leader5.24%
12/1/20PlayerB2.10% 12/1/20Leader3.71%
1/1/22PlayerB0.32% 1/1/21Leader-1.11%
2/1/21PlayerB0.93% 2/1/21Leader2.61%
3/1/21PlayerB0.24% 3/1/21Leader4.24%
4/1/21PlayerB1.59% 4/1/21Leader

5.24%

 

Player and Leader starting with $10,000
DatePlayerA$10,000 Leader$10,000
12/01/204.21%$10,421 3.71%$10,371
01/01/210.65%$10,488 -1.11%$10,256
02/01/211.87%$10,684 2.61%$10,524
03/01/210.48%$10,735 4.24%$10,970
      
Total Return7.35%  9.70%
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kar2022, 

 

According to your description, you want to forcast Player's and Leader's performance based on the "Forecast" tool. Here are my steps you can follow as a solution.

(1)This is my test data. 

Table “Leader” 

vtangjiemsft_0-1663151369861.png

Table “Player” 

vtangjiemsft_1-1663151369862.png

 

 The relationship between the tables is shown in the following diagram. 

vtangjiemsft_2-1663151369862.png

 

 (2)We can create  measures:  

 

10000-Player = IF( SUMX( FILTER( ALL('Player') , 'Player'[Date] <= SELECTEDVALUE('Leader'[Date]) && 'Player'[Player]= SELECTEDVALUE('Player'[Player])  ) , [Gains]) * 10000 <> BLANK() ,  SUMX( FILTER( ALL('Player') , 'Player'[Date] <= SELECTEDVALUE('Leader'[Date]) && 'Player'[Player]= SELECTEDVALUE('Player'[Player]) ) , [Gains]) * 10000+10000)   

 

 

 

10000-Leader = SUMX( FILTER( ALL('Leader') , 'Leader'[Date]<=            SELECTEDVALUE('Leader'[Date])  ) , [Gains]) *10000+10000 

 

 

 

(3)Then the result is as follows. 

vtangjiemsft_3-1663151369863.png

If this method does not meet your needs, you can provide us with detailed input and output examples in tabular form so that we can better solve the problem for you. 

 

Best Regards, 

Neeko Tang 

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
Anonymous
Not applicable

Hi @kar2022, 

 

According to your description, you want to forcast Player's and Leader's performance based on the "Forecast" tool. Here are my steps you can follow as a solution.

(1)This is my test data. 

Table “Leader” 

vtangjiemsft_0-1663151369861.png

Table “Player” 

vtangjiemsft_1-1663151369862.png

 

 The relationship between the tables is shown in the following diagram. 

vtangjiemsft_2-1663151369862.png

 

 (2)We can create  measures:  

 

10000-Player = IF( SUMX( FILTER( ALL('Player') , 'Player'[Date] <= SELECTEDVALUE('Leader'[Date]) && 'Player'[Player]= SELECTEDVALUE('Player'[Player])  ) , [Gains]) * 10000 <> BLANK() ,  SUMX( FILTER( ALL('Player') , 'Player'[Date] <= SELECTEDVALUE('Leader'[Date]) && 'Player'[Player]= SELECTEDVALUE('Player'[Player]) ) , [Gains]) * 10000+10000)   

 

 

 

10000-Leader = SUMX( FILTER( ALL('Leader') , 'Leader'[Date]<=            SELECTEDVALUE('Leader'[Date])  ) , [Gains]) *10000+10000 

 

 

 

(3)Then the result is as follows. 

vtangjiemsft_3-1663151369863.png

If this method does not meet your needs, you can provide us with detailed input and output examples in tabular form so that we can better solve the problem for you. 

 

Best Regards, 

Neeko Tang 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

Hi Neeko,

Thank you very much.  It worked.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.