calculate(countrows )) query

gmazza76

Well-known Member
Joined
Mar 19, 2011
Messages
769
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon,

I have written a DAX formula in PowerPivot to calculate how many people in the business area have made a sale, but I now need to look at previous months data and am wondering how to add this to the code, but I need to be able to do this each day for the full month (weeks in the month) and am unsure how to do this.

Can I just add another filter to match the date as I currently get an error when I do this

Code:
=CALCULATE(COUNTROWS(Data),
filter(Data,Data[Agent]=Departmentl[Agent]),
filter(Data,Data[model]=Department[Model])) - This gives me the figure

But I need to add a specific Date for each column I have. I need to get this to calculate in the format "dd/mm/yy hh:mm:ss" as I need to calulate the date from 8pm to 8am the following day or I can use a separate column with the date in format "dd/mm/yy" but it still fails
Code:
=CALCULATE(COUNTROWS(Data),
filter(Data,Data[Agent]=Departmentl[Agent]),
filter(Data,Data[model]=Department[Model]),
filter(Data,Data[date]=value"30/11/20")))

thanks in advance
Gavin
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I have realised I was using the wrong formula, I have used DATE(2020,11,30) and made sure the column the formula looks up is as a date
 
Upvote 0
Solution

Forum statistics

Threads
1,223,740
Messages
6,174,223
Members
452,552
Latest member
Kleets

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top