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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Paulo123
Frequent Visitor

Saldo acumulado ::: running

olá

quero calcular o saldo acumulado, da seguinte tabela (V ACUMULADO):

V LIQUIDOV ACUMULADO
-36 900 000 €-36 900 000 €
-57 300 000 €-94 200 000 €
-61 500 000 €-155 700 000 €
18 900 000 €-136 800 000 €
-57 000 000 €-193 800 000 €
-15 900 000 €-209 700 000 €
-23 700 000 €-233 400 000 €
-45 900 000 €-279 300 000 €
-47 400 000 €-326 700 000 €
-11 400 000 €-338 100 000 €
-48 300 000 €-386 400 000 €
30 600 000 €-355 800 000 €

 

V Liquido é uma medida que determinar o valor liquido, quero agora criar outra medida para acumular o V Liquido todos os meses.. 

 

2 ACCEPTED SOLUTIONS
v-zhangti
Community Support
Community Support

Hi, @Paulo123 

 

I simulated some of the data hoping to restore your problem.

vzhangti_0-1643083464181.png

Measure:

V LIQUIDO = CALCULATE(SUM('Table'[Sales]))
V ACUMULADO = 
CALCULATE (
    SUMX ( VALUES ( 'Table'[Date] ), [V LIQUIDO] ),
    FILTER ( ALLSELECTED ( 'Table' ), [Date] <= MAX ( 'Table'[Date] ) ))

vzhangti_1-1643083534857.png

 

Best Regards,

Community Support Team _Charlotte

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

Paulo123
Frequent Visitor

hi,

how do I limit the sum period, for example accumulate only 3 previous periods

View solution in original post

7 REPLIES 7
Paulo123
Frequent Visitor

hi,

how do I limit the sum period, for example accumulate only 3 previous periods

Hi, @Paulo123 

 

Measure:

Measure = 
Var N1=SUMMARIZE(filter(ALL('Table'),[Date]<=MAX('Table'[Date])),[Date],"Sum",SUM('Table'[Sales]))
Var N2=TOPN(3,N1,[Date],DESC)
Return
SUMX(N2,[Sum])

vzhangti_0-1643188427134.png

 

Best Regards,

Community Support Team _Charlotte

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

v-zhangti
Community Support
Community Support

Hi, @Paulo123 

 

I simulated some of the data hoping to restore your problem.

vzhangti_0-1643083464181.png

Measure:

V LIQUIDO = CALCULATE(SUM('Table'[Sales]))
V ACUMULADO = 
CALCULATE (
    SUMX ( VALUES ( 'Table'[Date] ), [V LIQUIDO] ),
    FILTER ( ALLSELECTED ( 'Table' ), [Date] <= MAX ( 'Table'[Date] ) ))

vzhangti_1-1643083534857.png

 

Best Regards,

Community Support Team _Charlotte

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

 

Paulo123
Frequent Visitor

olá,

tentei aplicar os dois modelos, mas deparei com o mesmo problema em ambos os casos, diz que este parametro não é correto:

CALCULATE(SUM([V LIQUIDO].
O V LIQUIDO já é uma medida.
 
 

olá,

você precisa de referência de tabela:

[V Liquido YTD]=CALCULATE(SUM('Tabela'[V Liquido]),DATESYTD('calendário'[Date]))

[acumular o V Liquido] = var _date =MAX('calendário'[Date]) return
CALCULATE(SUM('Tabela'[V Liquido]),ALL(calendário),calendário'[Date]<=_date)






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ValtteriN
Super User
Super User

Olá,

por YTD:

[V Liquido YTD]=CALCULATE(SUM('Table'[V Liquido]),DATESYTD('Calendar'[Date]))

por acumular:
[acumular o V Liquido] = var _date =MAX('Calendar'[Date]) return
CALCULATE(SUM('Table'[V Liquido]),ALL(Calendar),Calendar'[Date]<=_date)







Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




goncalogeraldes
Super User
Super User

Hello @Paulo123, you can try the following and check if it works for you:

Cumulative Measure =
VAR _min =
    MIN ( DimDate[Datekey] )
VAR _max =
    CALCULATE ( MAX ( Sales[DateKey] ), ALL ( Sales ) )
VAR _sales =
    CALCULATE (
        SUM(Sales[Amount]),
        FILTER (
            ALL ( DimDate[Datekey] ),
            DimDate[Datekey] <= MAX ( ( DimDate[Datekey] ) )
        )
    )
RETURN
    IF ( _min <= _max, _sales, 0 )

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!

You can also check out my LinkedIn!

Best regards,
Gonçalo Geraldes

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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