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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Roberto_F
New Member

How to do accumulate using a measure?

Hello, i am creating a report for rentabiliti using the rules that my client wants. At this moment i am facing a problem that can't solve.
I need to accumulate the rentabiliti of each month, using the exprexion.

((1+rentabiliti %)*(1+rentabiliti %))-1

The visual that i want to show the results is a matrix.

 

Details:

The rentabiliti measure.

 

01 Retirada Mes = CALCULATE(SUM(fMovimentacao[VALOR]),fMovimentacao[ACAO] = "RETIRADA")*-1
01 Aporte Mes = CALCULATE(SUM(fMovimentacao[VALOR]),fMovimentacao[ACAO] = "REINVESTIMENTO ATIVO")*-1
.Investimento =
var vinvestimento
SUMX(SUMMARIZE( 'fRendimentosMensais','fRendimentosMensais'[ID], "MenorInvestimento",MIN(fRendimentosMensais[Investimento])),[MenorInvestimento])
var ainvestimento = v
investimento + [01 Investimento psterior]
Return
IF(ainvestimento < 0, BLANK(), ainvestimento)

 

02 Rent Final =
 VAR rent1 = DIVIDE([01 Total Posição]-[01 Retirada Mes], [.Investimento])-1
 VAR rent2 = DIVIDE(([01 Total Posição]-[01 Aporte Mes]-[01 Retirada Mes]),[01 Posi ant])-1
 return
 IF([01 Total Posição] = BLANK(),BLANK(),
    IF([01 Posi ant] = BLANK(),
                     rent1,
                        rent2))
The visual I want to show the accumulated value.
Roberto_F_0-1719975427743.png

 

5 REPLIES 5
Roberto_F
New Member

I used the second measure and i got it simple acumulated.

 

Cumm Sum=

CALCULATE(sumx(values(dCalendario[Mes/Ano]),[02 Rent Final]) ,filter(all(dCalendario),dCalendario[Data]<=max(dCalendario[Data])))
 
But my rentabiliti is percentage, so i can'nt just sum, i need to do like:
 
((1+[02 Rent Final]){Month1}  * (1+ [02 Rent Final]) ){Month1}  -1 ......
 
It's possible?

Hi,

Your question is not clear.  Share some data, explain the question and show the expected result.  Share data in a format that can be pasted in an Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Roberto_F , Assuming you are using a date table, you can have measures like

 

Cumm Sum = CALCULATE(sumx(values('Date'[Date]),[02 Rent Final]) ,filter(all('Date'),'Date'[date] <=max('Date'[date])))

 


Cumm Sum = CALCULATE(sumx(values('Date'[Month Year]),[02 Rent Final]) ,filter(all('Date'),'Date'[date] <=max('Date'[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

Hello @amitchandak , thanks for your help.

 

I used the second measure and i got it simple acumulated.

 

Cumm Sum=

CALCULATE(sumx(values(dCalendario[Mes/Ano]),[02 Rent Final]) ,filter(all(dCalendario),dCalendario[Data]<=max(dCalendario[Data])))
 
But my rentabiliti is percentage, so i can'nt just sum, i need to do like:
 
((1+[02 Rent Final]){Month1}  * (1+ [02 Rent Final]) ){Month1}  -1 ......
 
It's possible?

Hi @Roberto_F ,

 

You can change the final data format to percentage with this function:

vtianyichmsft_0-1720425665445.png

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.