Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217451

Calculating Total Daily Value

$
0
0

 

I have a table which shows two metrics - by day.

 

Windows_10_x64.png

 

  1. Metric 1 is a calcuated column that is computed as a daily value 
  2. Metric 2 is a measure that is computed as a MTD value of another item ( not a MTD of metric 1).

 

I need to create a column ( or a measure - whichever is the best ) to compute the total of the two metrics on a daily basis i.e Metric 1 + daily value of metric 2 ( not MTD value ). BTW - This cost item can only valid when calculated as a MTD value. 

 

Not sure how to set this up.  Wondering if I have to first calculate the daily delta for the MTD measure, then add that value to metric 1. what happens on the first day of each month for such a calculation etc.

 

Below is the calculation for metric 2  (with help from  to contruct this)

 

test =
CALCULATE (
    CALCULATE (
        ( SUM ( Summary[qty] ) - MAX ( RatesTable[USAGE FROM] ) )
            * MAX ( RatesTable[RATES] )
            + MAX ( RatesTable[$Amount] ),
        FILTER (
            RatesTable,
            SUM ( Summary[qty] ) < RatesTable[USAGE TO]&& SUM ( Summary[qty] ) >= RatesTable[USAGE FROM]
        ),
        FILTER (
            RatesTable,
            MAX ( Summary[Date] ) < RatesTable[DATE TO]&& MAX ( Summary[date] ) >= RatesTable[DATE FROM]
        )
    ),
    FILTER (
        ALL ( Calendar ),
        Calendar[MonthID] = MAX ( Calendar[MonthID] )&& Calendar[Date] <= MAX ( Calendar[Date] )
    )
)

 

 


Viewing all articles
Browse latest Browse all 217451

Trending Articles