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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
algoritmia_pbi
Regular Visitor

roll up values in column

Hi I have a dataset like the following and would like to have something similar to the third column

 

Date                     Sales             Column I need: Sales rollup

March 1                  500                              500

March 3                  200                              700

March 5                  300                              1000

March 18                100                              1100

Apri 3                     250                               250    --> it starts over in a new month

Apr 7                      300                                550

 

 

Thanks

 

 

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@algoritmia_pbi 

you can try this

Column = sumx(FILTER('Table','Table'[date]<=EARLIER('Table'[date])&&year('Table'[date])=YEAR(EARLIER('Table'[date]))&&month('Table'[date])=month(EARLIER('Table'[date]))),'Table'[sales])

1.PNG





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

Proud to be a Super User!




View solution in original post

@algoritmia_pbi 

pls try this

 

Measure = sumx(FILTER(ALL('Table'),'Table'[date]<=max('Table'[date])&&YEAR('Table'[date])=YEAR(MAX('Table'[date]))&&MONTH('Table'[date])=MONTH(MAX('Table'[date]))),'Table'[Sales2])

1.PNG

 

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

@algoritmia_pbi 

you can try this

Column = sumx(FILTER('Table','Table'[date]<=EARLIER('Table'[date])&&year('Table'[date])=YEAR(EARLIER('Table'[date]))&&month('Table'[date])=month(EARLIER('Table'[date]))),'Table'[sales])

1.PNG





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

Proud to be a Super User!




Hey thank you, can this be done in a table visual? I tried but got me an error

algoritmia_pbi_0-1685814899450.png

 

are you creating a meausre? I created a column .

 





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

Proud to be a Super User!




Yes @ryan_mayu it's a measure, sorry if I didn't mentioned it

@algoritmia_pbi 

pls try this

 

Measure = sumx(FILTER(ALL('Table'),'Table'[date]<=max('Table'[date])&&YEAR('Table'[date])=YEAR(MAX('Table'[date]))&&MONTH('Table'[date])=MONTH(MAX('Table'[date]))),'Table'[Sales2])

1.PNG

 

pls see the attachment below





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

Proud to be a Super User!




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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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