Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get Daily sum

I have a table with date and sales but when I applied summation to get daily sum it gives wrong results. I used:

 

Daily Sales = SUM(sales[Sales])

 

My original table (sales):

After using the formula, I get summation as below (which is wrong):

 

Please help!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    You could create a measure like below.

    measure = calculate(sum(sales[sales]),filter(allselected('sales'),'sales'[date]=selectedvalue('date'[date])))

     

    Best Regards,

    Jay

9 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi Anonymous ,

     

    Are you using date and sales from same table or different?

     

    Thanks,

    Samarth

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI! From different tables. Date from calander table and sales from sales table. I joined them based on the date.

      • Anonymous's avatar
        Anonymous
        Not applicable

        I summarized using 'sum' in the table view insdead  of calculated measure, and still getting the same results, which is wrong. Thanks!

    • Anonymous's avatar
      Anonymous
      Not applicable

      I am not sure how but, re-doing the model gave the correct solution. Thanks all

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    You could create a measure like below.

    measure = calculate(sum(sales[sales]),filter(allselected('sales'),'sales'[date]=selectedvalue('date'[date])))

     

    Best Regards,

    Jay