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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
geerduran
Frequent Visitor

Acumulate value

Hello, I have a dataset like this

 

index  number  amount  balance
1          10775          10         10
2          10775         -10           0
3          10775           20         20
4          10775         -20           0   
5          10775           10         10
6          10775           10         20
7           10775          10         30
8           10776          10         10
9           10776          10         20
10         10776         -10         10
11         10776          10          20

 

 

I would like to get the Number of column balance acumulated by number group.

Thanx in advance for help

3 REPLIES 3
amitchandak
Super User
Super User

@geerduran , New measure

calculate(sum(Table[amount]) , filter(allselected(Table), table[number] = max(table[number]) && table[index] = max(table[index])))

 

new column

sumx( filter(Table, table[number] = earlier(table[number]) && table[index] = earlier(table[index])),Table[amount])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak , but balance is same as amount with new column code

 

balance = sumx( filter(table, table[number] = earlier(table[number]) && table[index] = earlier(table[index])),table[amount])

 

index  number  amount  balance
1          10775          10         10
2          10775         -10       -10 
3          10775           20        20
4          10775         -20       -20   
5          10775           10        10
6          10775           10        10
7           10775          10        10
8           10776          10       10
9           10776          10       10
10         10776         -10      -10
11         10776          10        10

 

Did I write something wrong?

geerduran
Frequent Visitor

This is an answer

 

balance =
CALCULATE (
SUMX ( 'Table', [amount] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[number] ),
'Table'[index] <= MAX ( 'Table'[index] )
)
)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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