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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
JLambs20
Helper III
Helper III

Create a New Cumulative Column using DISTINCT

Hello!

 

I need to create a column of running totals based on a previous column.  However, the previous column contains multiple iterations of one value.  I need to be able to add my next value to just one unique value (not all iterations of it).  Please see the referenced Excel screenshot for a better explanation. Please notice that the values will need to keep "Project" and "Sprint" in mind as filter criteria.

 Excel DAX .png

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JLambs20 ,

You can create a calculated column or measure as below to achieve it:

1. Calculated column

Column for Cumulative Points = 
VAR _tab =
    SUMMARIZE (
        FILTER (
            ALL ( 'AZUP - Apollo Main Data' ),
            'AZUP - Apollo Main Data'[Project]
                = EARLIER(  'AZUP - Apollo Main Data'[Project] )
                && 'AZUP - Apollo Main Data'[Sprint]
                    <= EARLIER ( 'AZUP - Apollo Main Data'[Sprint] )
        ),
        'AZUP - Apollo Main Data'[Project],
        'AZUP - Apollo Main Data'[Sprint],
        "point", MAX ( 'AZUP - Apollo Main Data'[Points] )
    )
RETURN
    SUMX ( _tab, [point] ) 

2. Measure

Cumulative Points = 
VAR _tab =
    SUMMARIZE (
        FILTER (
            ALL ( 'AZUP - Apollo Main Data' ),
            'AZUP - Apollo Main Data'[Project]
                = SELECTEDVALUE ( 'AZUP - Apollo Main Data'[Project] )
                && 'AZUP - Apollo Main Data'[Sprint]
                    <= SELECTEDVALUE ( 'AZUP - Apollo Main Data'[Sprint] )
        ),
        'AZUP - Apollo Main Data'[Project],
        'AZUP - Apollo Main Data'[Sprint],
        "point", MAX ( 'AZUP - Apollo Main Data'[Points] )
    )
RETURN
    SUMX ( _tab, [point] )

yingyinr_1-1617693543910.png

Best Regards

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @JLambs20 ,

You can create a calculated column or measure as below to achieve it:

1. Calculated column

Column for Cumulative Points = 
VAR _tab =
    SUMMARIZE (
        FILTER (
            ALL ( 'AZUP - Apollo Main Data' ),
            'AZUP - Apollo Main Data'[Project]
                = EARLIER(  'AZUP - Apollo Main Data'[Project] )
                && 'AZUP - Apollo Main Data'[Sprint]
                    <= EARLIER ( 'AZUP - Apollo Main Data'[Sprint] )
        ),
        'AZUP - Apollo Main Data'[Project],
        'AZUP - Apollo Main Data'[Sprint],
        "point", MAX ( 'AZUP - Apollo Main Data'[Points] )
    )
RETURN
    SUMX ( _tab, [point] ) 

2. Measure

Cumulative Points = 
VAR _tab =
    SUMMARIZE (
        FILTER (
            ALL ( 'AZUP - Apollo Main Data' ),
            'AZUP - Apollo Main Data'[Project]
                = SELECTEDVALUE ( 'AZUP - Apollo Main Data'[Project] )
                && 'AZUP - Apollo Main Data'[Sprint]
                    <= SELECTEDVALUE ( 'AZUP - Apollo Main Data'[Sprint] )
        ),
        'AZUP - Apollo Main Data'[Project],
        'AZUP - Apollo Main Data'[Sprint],
        "point", MAX ( 'AZUP - Apollo Main Data'[Points] )
    )
RETURN
    SUMX ( _tab, [point] )

yingyinr_1-1617693543910.png

Best Regards

Ashish_Mathur
Super User
Super User

Hi,

Please show the expected result in a simple Table.


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

@JLambs20 , Try a measure like

sumx(addcolumns(summarize(Table, Table[project], Table[sprint], Table[points]), "_1",calculate(sum(Table[points]),filter(allselected(Table), [sprint] <=max([sprint]) && [project] = max([project])))),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Unfortunately, I'm getting an error.  What am I missing?

Excel DAX 2.png\

 

@JLambs20 , after the filter getting closed after [sprint]  before <= max is at the wrong place. remove and correct

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.