Forum Discussion

rpinxt's avatar
rpinxt
Solution Sage
3 years ago
Solved

3 different formulas with same outcome....why?

I have these measures :

Prod_ACT = [Actual] / [FTE_ACT]

 

Prod_Ytd_ACT = CALCULATE([Prod_ACT],DATESYTD(Dim_Date[Date]),VALUES(Dim_Date[Period]))

 

Prod_Ytd_ACT2 = TOTALYTD([Prod_ACT],Dim_Date[Date].[Date])

 

But they give me all 3 the same amount every month :

 

Why are the 2 with Ytd still breaking down on period?

I don't want them to break up to field Period.

I want them to add up all previous periods from that year.

  • rpinxt Try this:

    Measure = 
        VAR __Date = MAX(Dim_Date[Date])
        VAR __Year = MAX('Dim_Date'[Year])
        VAR __Table = 
            SUMMARIZE(
                FILTER(
                    ALL('Dim_Date'),
                    [Date] <= __Date && [Year] = __Year
                ),
                [Period],
                "__Prod_ACT",[Prod_ACT]
            )
    RETURN
        AVERAGEX(__Table,[__Prod_ACT])

9 Replies