Measure to Count number of dates in each month

Mavericks334

Active Member
Joined
Jan 26, 2011
Messages
280
Hi,

I have 5 tables, Period(Month) Table, Date Table, Year, Year Period Table and Raw Data table. There is a relationship between each of these table.

From the raw data table i have two columns Actual Date Out and Actual date back.

How do i create metric to get the count for the number of days for Actual date out and actual date back for each month. The month Name is the column.

Regards,
Renato.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi,

Below are the sample tables,

Table 1 Ops Team
Item Id Status Expected Due Out Actual Due Out Expected Due Back Actual Due Back
49308 Closed 9/1/2015 9/8/2015 9/2/2015 9/8/2015
52420 Closed 9/2/2015 9/2/2015 9/3/2015
52421 Closed 9/3/2015 9/3/2015 9/3/2015 9/3/2015
52425 Closed 9/9/2015 9/9/2015 9/9/2015 9/9/2015
52430 Closed 9/14/2015 9/14/2015 9/14/2015
52431 Closed 9/15/2015 9/15/2015 9/15/2015 9/21/2015

Table 2 Audit Team
Item Id Status Date Pending Audit Audit by Date Close Date
53566 Closed 8/19/2015 8/20/2015 8/19/2015
53702 Closed 9/1/2015 9/2/2015 9/1/2015
53703 Closed 9/1/2015 9/2/2015 9/1/2015
53696 Closed 9/18/2015 9/2/2015 9/18/2015
53707 Closed 9/1/2015 9/2/2015 9/1/2015
53708 Closed 9/8/2015 9/8/2015

Below is how i would like to have the summary with the year as filter.

Status July August September October NovemberActual Out
Actual In
Audit Closed



The date table is linked to both these tables.

Regards,
Renato.
 
Last edited:
Upvote 0
Depends on how you intend to use this...

NumDays := COUNTROWS(Calendar)

... typically works out just fine for me.
 
Upvote 0
Thanks Scott. This would only give me the count of rows in the calendar table. I need the count from the other two tables and show it in a single summary pivot.
 
Upvote 0
Somehow I read " get the count for the number of days for " and went there.

So, I'm thinking you kinda want DataBack - DataOut = NumDays? Like, 2015-08-05 -> 2015-08-25 is 20 (or 21?) days. And you can literally just subtract 2 dates to get a # of days.

However, I suspect you are asking for something a bit more complicated, like 2015-08-05 -> 2015-10-25 means you were "out" for all the days in Sept (plus some in Aug/Oct).

For that, I recommend you search the googles... for "DAX Events in Progress", as I know there are some good blogs on that pattern.
 
Upvote 0

Forum statistics

Threads
1,224,126
Messages
6,176,519
Members
452,733
Latest member
Gao87

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