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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
spoony
Helper I
Helper I

Running total of a measure

I have a table - Data, with columns:

 

Year - Date type

Sales - Whole number

Cost - Whole number

 

I created a measure for Profit = Table[Sales] - Table[Cost]

 

How do i put the measure "Profit" in this following running total formula. It doesn't show the measure as an input on the Sum function:

 

Running Profit COLUMN = CALCULATE (

SUM ( 'Profit' ), 

ALL ( 'Data' ),

'Data'[Year] <= EARLIER ( 'Data'[Year] ) )

 

 

 

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @spoony

 

This might be close to what you need, and it doesn't rely on your other measures.

 

Running Total Column = SUMX(
        FILTER(
                'Table1',
                'Table1'[Year]<=EARLIER('Table1'[Year])
                ),
           'Table1'[Sales]-'Table1'[Cost])

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Phil_Seamark
Employee
Employee

Hi @spoony

 

This might be close to what you need, and it doesn't rely on your other measures.

 

Running Total Column = SUMX(
        FILTER(
                'Table1',
                'Table1'[Year]<=EARLIER('Table1'[Year])
                ),
           'Table1'[Sales]-'Table1'[Cost])

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Thanks phil, its kinda working. My filter on one of the columns of this table is causing it to not work so i have to look into.

ok, feel free to post back here if you need more help 🙂


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.