Forum Discussion
bullius
9 years agoHelper V
Using Running Total in Calculations
Hi, I have a measure that calculates the running total of no. of companies. I want to multiply this figure for a given year by another amount, e.g. Year Running Total Amount Desired Res...
v-jiascu-msft
9 years agoMicrosoft Employee
Hi bullius,
What is your formula of "Running Total"? Maybe you could try to modify the formula like this:
Running Total =
CALCULATE (
COUNT ( 'table'[company] ),
FILTER ( ALL ( 'table' ), 'table'[year] <= MAX ( 'table'[year] ) )
)Best Regards!
Dale
bullius
9 years agoHelper V
Hi,
Here is the formula for the Running Total:
Running Total = CALCULATE ( DISTINCTCOUNT ( Fact_OccasionsComp[CompanyID] ), Fact_OccasionsComp[CompOccasion] = "Established", FILTER ( ALLSELECTED ( Fact_OccasionsComp ), Fact_OccasionsComp[Date] <= MAX ( Dim_Calendar[Date] ) ) ) - CALCULATE ( DISTINCTCOUNT ( Fact_OccasionsComp[CompanyID] ), Fact_OccasionsComp[CompOccasion] = "Closed", Fact_OccasionsComp[Date] = null ), FILTER ( ALLSELECTED ( Fact_OccasionsComp ), Fact_OccasionsComp[Date] <= MAX ( Dim_Calendar[Date] ) ) )
It is basically the same as the one you suggested, but with a few differences ("Established" - "Closed", ALLSELECTED, rather than ALL etc...)