To generate report of payment received from one date to another date

I am working on a software for clinic. I have a Table which takes entry of my patients โ€œdateโ€ wise. I have another column โ€œPayment Receivedโ€.
I want to generate report of sum of payment received from โ€œone particular dateโ€ to " another particular date". How to do it. Please help.

0 17 534
17 REPLIES 17

You could try something like this:
SUM(SELECT(payment received[amount] , AND( [date] < โ€œxx/yy/zzzzโ€ , [date] > โ€œxx/yy/zzzzโ€)))

What I am doing wrong?

I see youโ€™re setting a row filter condition. Not sure about your strategy here, but if youโ€™re trying to create a slice with only the records in certain dates, then forget about the SUM(SELECT()) parts, just use the logical AND().

It is _THISROW, not _THISRAW.
Also, _thisrow is not an expression in itself, it is part of a deref, as in [_THISROW].[column].
And it should not be in quotation marks.
And you canโ€™t really use it in a sliceโ€™s row filter condition.

Are you trying to compare the date to other date columns, or to a specific hard-coded date?

Hereโ€™s an example for filtering rows in a slice by date.
AND([date]< "02/29/2020โ€ , [date]>"02/21/2020โ€)

Maybe you have a 2nd table, called Reports. In that table you have two columns, Date Start, Date End. If you want to sum the payments between those dates, create a virtual column with this expression.

SUM(SELECT(first table[payments received] , AND([date]< [_THISROW].[Date End] , [date]>[_THISROW].[Date Start])))

Got itโ€ฆ Thanks for your valuable help

I have single table named โ€œAll Patientsโ€
Inside that I have one column names [Date] which contains date wise entries of all new walk-in patient.

I have second column name [Payment Received] which contains amounts collected from particular patientโ€ฆ

Now I want to see sum of particular date range in dynamic mode in details viewโ€ฆ E.g from 1 February to 15th Februaryโ€ฆ

I am stuck here. I donโ€™t get idea how to do

SUM of payment received

How does the app know what the start and end date are for the range?

That is where I stuckโ€ฆ How to make it possibleโ€ฆ In my previous software I was able to see date range wise payments

Are you saying that you want users to be able to enter a starting and ending date for the report?
You then want to display the records between those two dates?

Are you trying to create a workflow report?
If not, can you explain how you want the report to be created?

Yesโ€ฆ For example I want to display total collection from 01/02/2020 to 01/31/2020.

Also my accountant want to download data between the date range to maintain 3C form. Or automatically on first of every month, workflow send email (xls) file of last monthโ€™s records.

Here I have only one column of [Date]

You can make a workflow->report to send monthly. In it you can SUM up all payments from the previous month with the following expression:

SUM(
     SELECT(  table[payments received] , 
                  AND([date] <=  EOMONTH( TODAY() , -1)  ,
                      [date] >=  EOMONTH( TODAY() , -2) + 1   
                     )
            )
    )

Thanksโ€ฆ Will try and update you.

this error occured



That field is the wrong spot to enter that formula. That field is for determining whether to fire the workflow. Please read up on workflows with the above articles. Youโ€™ll possibly want to enter that formula in an Email Body Template, and wrap the whole thing in << and >>, as shown in this screenshot.

Got it thoroughlyโ€ฆ Thanks

Top Labels in this Space