Quantcast
Channel: All Developer posts
Viewing all articles
Browse latest Browse all 48576

Re: Averages by time period and cumulative for averages

$
0
0

Maripo wrote:

Hi Eric, I was able to get averages for Demand, but not exactly the way I wanted them to be.

Problem one - my averages are not dynamic.  If I drill up or down in the visual, averages don't change, but I want them to change depending what level I am in - week, month or quarter. Also, I need to calculate Cumulative Total for those Averages, so on my visual I can compare Cumulative for Actual Sales Numbers (column) and Cumulative for Demand Numbers (line).   But regular formula to calculate cumulative doesn’t work on calculated averages. Here is the pbix file https://1drv.ms/u/s!AnlpTlk758V1aUrfkGtqgcArfvc

Thanks!


Measure won't change according to the drill down level, however you can try some tricks to distiguish the level. Try

Current Plan Demand Weekly Target =
VAR NumberOfMonth =
    DISTINCTCOUNT ( Date_Dim[Year Month] )
VAR NumberOfWeek =
    DISTINCTCOUNT ( Date_Dim[Year Week] )
VAR Months =
    CALCULATE ( DISTINCTCOUNT ( Date_Dim[Year Month] ), ALLSELECTED ( Date_Dim ) )
VAR Quarters =
    CALCULATE ( DISTINCTCOUNT ( Date_Dim[Year Quarter] ), ALLSELECTED ( Date_Dim ) )
VAR Weeks =
    CALCULATE ( DISTINCTCOUNT ( Date_Dim[Year Week] ), ALLSELECTED ( Date_Dim ) )
VAR CurrentPlanDemand =
    CALCULATE (
        Demand_Attainment_RRDemand[Current Plan Demand],
        ALLSELECTED ( Date_Dim )
    )
RETURN
    SWITCH (
        TRUE (),
        [Number Of Month] > 1, //Quarter level
        CurrentPlanDemand / Quarters,
        [Number Of Month] = 1&& [Number Of Week] > 1, //month level
        CurrentPlanDemand / [Number Of Weeks In Qtr]
            / Months,
        //Otherwise, week level)
        CurrentPlanDemand / Weeks
    )

As to "Cumulative Total for those Averages", I'm still not getting it. I know Cumulative Total or average, but what is Cumulative average? Could you be more specific?


Viewing all articles
Browse latest Browse all 48576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>