Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Count increase/decrease over time frame

$
0
0

I was tasked to build a formula letting us know how the month is tracking as far on inputs vs the past 12 months average.

 

The data is like the following

 

Table name: WO

two columns:

"doc_no,   Date"

 

The example would be today is Dec 13th.  There will be 10 unique dates in the table for this month because we are closed on weekends.  We have had 50 inputs(Doc_no) so far this month.  That is 5 a day for this month......50 inputs/10 unique dates.

 

Now, for the past 12 months, there has been 251 unique dates in the table...no weekends...no holidays.....  In that time we have had 2008 inputs(doc_no).  That is 8 a day for the past 12 months........2008 inputs/251 unique dates.

 

Thus, the result of my formula would be we are tracking down 37.5% in inputs for the month.....5 a day this month so far vs. 8 a day average the past 12 months = we are down -37.5% in inputs so far this month.

 

I have a date dimensions table joined to the date field in the WO table.   I attached an image of the datedimension table

 

Any ideas and thanks for the help!  The doc_no will be distinct in the table so no need to include this in the formula.  The formula below is what I have so far but I don't think I'm even close.

 

input% = DIVIDE(calculate(count('WO'[DOC_NO]),'DateDimension''[CurrentMonth])  ????  DIVIDE(count('WO'[DOC_NO]),countdistinct('WO'[Date]

 

Capture.PNG


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>