Forum Discussion

Mous007's avatar
Mous007
Icon for Helper IV rankHelper IV
6 years ago

Sum AP due before EOM ?

Hi all,

So i have the below measure calculated and its working correctly on my report but i want to use it to calculate three new measures that would calculate:

  1. only the invoices to be paid before the end of the month (last day of current month). i tried to use a function called EOMONTH but could not get it to work.
  2. second measure to only calculate the sum of invoices Where the due date is < first day of next month.  
  3.  measure to only calculate the sum of invoices Where the due date is > last day of current month.

I also know that the first two might give the same result but i would need to calculate them if possible.

 

I have a normal date table and i can also post the query i used to generate the table if needed.

My measure:

Total AP (Other than validated) =
        VAR _ConversionRate = SELECTEDVALUE('Currency table disconnected'[Currency Value],1)

Return
    CALCULATE(SUMX('Payables',DIVIDE(  Payables'[Invoice Amount] *
RELATED('Currency table' [Currency value]),_ConversionRate)),
'Payables'[Invoice Status] <> "Validated")
 
Data extract:
Invoice NumInvoice AmountDue date
Invoice 1254.574/29/2020
Invoice 2608.084/30/2020
Invoice 36114.845/1/2020
Invoice 4898.035/2/2020
Invoice 51605/3/2020
Invoice 63953.45/4/2020
Invoice 74135.425/5/2020
Invoice 811477.85/6/2020
Invoice 9942.55/7/2020
Invoice 103605.475/8/2020
Invoice 1118685.845/9/2020
Invoice 126988.85/10/2020
Invoice 137474.345/11/2020
Invoice 1432732.25/12/2020
Invoice 1518919.695/13/2020
Invoice 16964.515/14/2020
Invoice 176872.545/15/2020
Invoice 18126.865/16/2020
Invoice 1927790.355/17/2020
Invoice 20342033.865/18/2020
Invoice 213228.915/19/2020
Invoice 223228.915/20/2020
Invoice 2321526.085/21/2020
Invoice 2421526.085/22/2020
Invoice 2521526.085/23/2020
Invoice 2621526.085/24/2020
Invoice 27254.575/25/2020
Invoice 28608.085/26/2020
Invoice 296114.845/27/2020
Invoice 30898.035/28/2020
Invoice 311605/29/2020
Invoice 323953.45/30/2020
Invoice 334135.425/31/2020
Invoice 3411477.86/1/2020
Invoice 35942.56/2/2020
Invoice 363605.476/3/2020
Invoice 3718685.846/4/2020
Invoice 386988.86/5/2020
Invoice 397474.346/6/2020
Invoice 4032732.26/7/2020
Invoice 4118919.696/8/2020
Invoice 42964.516/9/2020
Invoice 436872.546/10/2020
Invoice 44126.866/11/2020
Invoice 4527790.356/12/2020
Invoice 46342033.866/13/2020
Invoice 473228.916/14/2020
Invoice 483228.916/15/2020
Invoice 4921526.086/16/2020
Invoice 5021526.086/17/2020
Invoice 5121526.086/18/2020
Invoice 5221526.086/19/2020

***

Any other details needed, please let me know. 

Thanks in advance.

Mous

3 Replies

  • Mous007 , Try if these can work

    calculate(sum(Table[Invoice Amount]), filter(Table, Table[due_date]<eomonth(Table[due_date],0)))
    calculate(sum(Table[Invoice Amount]), filter(Table, Table[due_date]<eomonth(Table[due_date],0)+1))
    calculate(sum(Table[Invoice Amount]), filter(Table, Table[due_date]>eomonth(Table[due_date],0)))

    Based on Today

    calculate(sum(Table[Invoice Amount]), filter(Table, Table[due_date]<eomonth(Today(),0)))
    calculate(sum(Table[Invoice Amount]), filter(Table, Table[due_date]<eomonth(Today(),0)+1))
    calculate(sum(Table[Invoice Amount]), filter(Table, Table[due_date]>eomonth(Today(),0)))
  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Mous007 ,

     

    Is this problem solved?

     

     

    Best Regards,

    Icey