Forum Discussion

troyhimes's avatar
troyhimes
Icon for Resolver I rankResolver I
6 years ago

Yet another MTD question!

Yet Another MTD Question! (udpated) Dropbox File

 

With the forum's help I was able to solve a couple of related questions, but this one has me stumped.  The MTD values (BTZ Feed Ozs MTD) do not equal the cumulative daily values (BTZ Feed Ozs).  See sheet below: Grand Total MTD = 3714 & cumulative daily = 3870.

 

BTZ Feed Ozs = Btz Tons * BTZ 30day avg (trailing 30 day avg)

 

Current Result:   

     BTZ Feed Ozs MTD = Btz Tons (MTD) * BTZ 30day avg (daily)

 

Desired Result

     BTZ Feed Ozs MTD = sum of each day's BTZ Feed Ozs 

 

 

5 Replies

    • troyhimes's avatar
      troyhimes
      Icon for Resolver I rankResolver I

      Thanks for the links Greg, I wasn't aware of the HASONExxxxx functions.

       

      I may not be seeing it, but I don't think it's the solution to this issue though.  The Grand Total value is not used for anything, I'm just displaying it for illustration purposes in this post.  My issue is with the MTD calculation.....I don't know if I'm using the correct terminology but how do I keep the row to row context when adding the daily values for the MTD calc?

       

      As expected, the 3/1 daily BTZ Feed Ozs calc uses the row context (3/1 Btz Tons * 3/1 BTZ 30day avg) as does the MTD.

               3/1 Daily=312    &    MTD=312

       

      On subsequent days (example 3/2), again as expected the 3/2 daily BTZ Feed Ozs calc uses the row context (3/2 Btz Tons * BTZ 30day avg) BUTthe MTD calc uses (Cumulative Feed Ozs * Current Row daily 30day avg ----> 3/1 + 3/2 BTZ Feed Ozs * 3/2 BTZ 30day avg)

               3/2 Daily=271    &     MTD=591

       

      The daily values return 312+271=583 but my MTD value is returning 591 based on the calc above.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable
        // Calendar must be the Date table in the model
        // marked as such.
        
        [BTZ Feed Ozs MTD] =
        	sumx(
        		DATESMTD( Calendar[Date] ),
        		[Btz Tons] * [Btz 30day avg]
        	)

         

        Best

        D