Forum Discussion

dataloverhir's avatar
dataloverhir
Regular Visitor
8 years ago

Calculate Sales from YTD problem

I have a problem calculating YTD from my sales tables contaning user id, date when invoice is paid, total ( $$ in the transaction) and status of the invoice ( paid or unpaid).

Datepaid column data type is 'date'.

 

I create a 'date table', and the relationship between the two tables:


 

The relationship created:

 

This is the measure i used to calculate YTD:

MTDSumOfSales = TOTALMTD([SumOfSales];'Calendrier'[Date].[Date])

Where sumof sales = sum of  all paid invoice.

No thing is working , and i cant figure out where the problem

Please help,

Thank you,

5 Replies

  • Hi,

     

    Is SumOfSales a measure that you have written?  If yes, then what is that measure?  What happens when you drag that measure to your visual?

    • dataloverhir's avatar
      dataloverhir
      Regular Visitor
      Hi, This measure calculate the sum of all paid invoice ( SumOfSales = SUM('autosync_whmcs tblinvoices'[total])) In the visual, it show the same value ( the sum of all sales) in every month, and it is not what i want (