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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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