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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
lisannegesch
Frequent Visitor

How can I make an cummulative calculation of the amounts ofassets with an specific value over time?

Hi all,

 

I've a dataset with different columns:

 

- Asset

- Quantity of asset

- Date placed

- Details of the asset

 

Now I want to make a column that calculates the cummulative quantity of an asset with a specific detail. For example, I want to see how many assets are white based on the dates as well:

lisannegesch_0-1665651020473.png

 

Could somewone help me?

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @lisannegesch ,

 

try this calculated column, it works!

 

Column =
IF (
    'Table'[Details] = "white",
    CALCULATE (
        SUM ( 'Table'[quantity] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date]
                <= EARLIER ( 'Table'[Date] )
                && 'Table'[Details] = "white"
        )
    ),
    BLANK ()
)
 
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

4 REPLIES 4
mangaus1111
Solution Sage
Solution Sage

Hi @lisannegesch ,

 

try this calculated column, it works!

 

Column =
IF (
    'Table'[Details] = "white",
    CALCULATE (
        SUM ( 'Table'[quantity] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date]
                <= EARLIER ( 'Table'[Date] )
                && 'Table'[Details] = "white"
        )
    ),
    BLANK ()
)
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-luwang-msft
Community Support
Community Support

Hi @lisannegesch ,

Use the dax like the below to create a new column:

 

Column = IF('Table'[Details]="white",CALCULATE(SUM('Table'[quantity]),FILTER(ALL('Table'),'Table'[Date]<=EARLIER('Table'[Date])&&'Table'[Details]="white")),BLANK())

 

Output result:

 

vluwangmsft_0-1666161944085.png

 

 

 

Best Regards

Lucien

piotr_gor
Helper II
Helper II

Try: 

CALCULATE( 
SUM('Table'[Quantity] ),
ALL ('Table'),

'Table'[Details] = "white",
'Table'[Date] <= MAX( 'Table'[Date] )
)

Thanks for your fast reply and help :).  I do get a calculation but it isn't cummulative (all the results are the same), it also shows results in the column where the detail isn't met.

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.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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