Forum Discussion

venug's avatar
venug
Icon for Helper II rankHelper II
5 years ago

DAX - Average Daily Sales MTD

Hi Everyone,

 

I am trying to calculate ADS MTD using DAX queries. But unable to get accuracy value. I am sharing my file in this link.

 

Please help on this calculation. 

 

Thanks in advance.

 

Regards

Venu

5 Replies

  • venug , Try like example with help from date table

     

    MTD = CALCULATE(Average(Sales[Sales Amount]),DATESMTD('Date'[Date]))

     

    or

     

    MTD = CALCULATE(AverageX(values('Date'[Date])Sales[Sales Amount]),DATESMTD('Date'[Date]))

    • venug's avatar
      venug
      Icon for Helper II rankHelper II

      amitchandak ,

       

      Thanks for respond, I have already created ADS measure, on top of need calculate MTD. Please check my PBIX file. 

      Provided measure correct, but these two not suitable to my scenario.

       

      Regards,

      Venu

      • venug's avatar
        venug
        Icon for Helper II rankHelper II

        Dear all,

         

        Anybody please help on this.

         

        Regards,

        Venu

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Icon for Community Support rankCommunity Support

    Hi venug ,

     

    For your formula, I did a test, just add an all function to the created ADSMTDmeasure, keep the external filter conditions, you can get the correct expected result.

    ADSMTD = 
    CALCULATE ( [ADS], DATESMTD ( Orders[Order Date] ), ALL ( Orders ) )


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

    Best Regards,
    Henry

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • venug's avatar
      venug
      Icon for Helper II rankHelper II

      Hi v-henryk-mstf ,

       

      Thanks for you reply, i have already provided my desired output in given link. When i generate ADSMTD it should sum of all ADS values.

       

      Please find below snippet for my desired output.

       

       

      It's really great helpful to me, if will get solution for it.

       

      Regards,

      Venu