Forum Discussion

jamesgbrooks's avatar
jamesgbrooks
Frequent Visitor
8 years ago
Solved

Basic MTD Sales Calculation Not Summing Individual Days

Hello,   I am having issues with my MTD Sales calculation. It should be summing up cumulative sales through the month, but instead, it is outputting the exact same value as the total cost forumla s...
  • Thejeswar's avatar
    Thejeswar
    8 years ago

    jamesgbrooks,

    You are getting this error because your fact table and Calendar table are related using an indirect relationship i.e. using some other table these two tables are already joined

     

    From your screenshot, it can be seen that you fact and calendar tables are joined using uvwDimDeliveryDate table.

    As it says, disable indirect relationship or change the cross filtering direction to single and then create a direct relationship between the fact and calendar tables. If done so, the already given measures will work.

     

    If that is not possible, In such case, what you can do is, create an inactive relationship between these tables

     

    1. Create a measure that will have the mny cost based on the inactive relationship as below

     

     

    mnycostmeasure = CALCULATE(sum(Fact[mnycost]), USERELATIONSHIP(Fact[Date], Calendar[Date]))

     

    2. Then create a TOTALMTD()  based on the newly created measure

     

    Measure 4 = TOTALMTD(mnycostmeasure,DateKey[Date]) 

     

    Hope this solves your issue