DATESYTD (or any Time Intelligent Function) Working Off Other Data Besides Date in the Pivot Table

I am working on a project where I need to count the number of events from the start of the year to the end for each year in the data with each event counting the current event and any previous events sequentially.  My results should look like the following:
MarketNameDate
MarketCount
2012-09-11|Kansas City
1
2012-09-18|Denver
2
2012-09-25|Chicago
3
2012-10-02|Seattle
4
2012-10-09|Phoenix
5
2012-10-16|Tampa
6
2012-10-23|Norfolk
7
2012-10-30|Alexandria
8
2012-11-06|San Jose
9
2012-11-27|Dallas
10
2012-12-04|Fort Lauderdale
11
2013-01-15|Los Angeles
1
2013-01-22|Orange County
2
My formula is as follows :=calculate(distinctcount(Event_Table[MarketNameDate]),datesytd(dates_dimensions[date_value]),all(dates_dimensions)).  This formula works correctly when I am using the Date_Dim table to drive the analysis in the Row Label or
Column Label in my Pivot Table.  My events table is connected directly to Date_Dim table and I would like to use the [MarketNameDate] field instead. 
I need to get a rolling count of the number of markets through the year, but roll up on [MarketNameDate] instead of anything out of Date_Dim.  Is this possible or do the Time Intelligence functions require you to only use Date_Dim columns as Row Label
or Column Label in my Pivot Table.
I would also be happy to have an alternative way of solving the problem if there is a way to do it.
Here is an approximation of the data I am using.
Seminar_Events
Event_Type
Market
MarketNameDate
MarketMinDate
Preview
Kansas City
2012-09-11|Kansas City
9/11/2012 0:00
Workshop
Kansas City
2012-09-11|Kansas City
9/11/2012 0:00
Preview
Denver
2012-09-18|Denver
9/18/2012 0:00
Workshop
Denver
2012-09-18|Denver
9/18/2012 0:00
Preview
Chicago
2012-09-25|Chicago
9/25/2012 0:00
Workshop
Chicago
2012-09-25|Chicago
9/25/2012 0:00
Preview
Seattle
2012-10-02|Seattle
10/2/2012 0:00
Workshop
Seattle
2012-10-02|Seattle
10/2/2012 0:00
Preview
Phoenix
2012-10-09|Phoenix
10/9/2012 0:00
Workshop
Phoenix
2012-10-09|Phoenix
10/9/2012 0:00
Preview
Tampa
2012-10-16|Tampa
10/16/2012 0:00
Workshop
Tampa
2012-10-16|Tampa
10/16/2012 0:00
Preview
Norfolk
2012-10-23|Norfolk
10/23/2012 0:00
Workshop
Norfolk
2012-10-23|Norfolk
10/23/2012 0:00
Preview
Alexandria
2012-10-30|Alexandria
10/30/2012 0:00
Workshop
Alexandria
2012-10-30|Alexandria
10/30/2012 0:00
Preview
San Jose
2012-11-06|San Jose
11/6/2012 0:00
Workshop
San Jose
2012-11-06|San Jose
11/6/2012 0:00
Preview
Dallas
2012-11-27|Dallas
11/27/2012 0:00
Workshop
Dallas
2012-11-27|Dallas
11/27/2012 0:00
Preview
Fort Lauderdale
2012-12-04|Fort Lauderdale
12/4/2012 0:00
Workshop
Fort Lauderdale
2012-12-04|Fort Lauderdale
12/4/2012 0:00
Preview
Los Angeles
2013-01-15|Los Angeles
1/15/2013 0:00
Workshop
Los Angeles
2013-01-15|Los Angeles
1/15/2013 0:00
Preview
Orange County
2013-01-22|Orange County
1/22/2013 0:00
Date_Dimensions
date_value
1/1/2012 0:00
1/2/2012 0:00
1/3/2012 0:00
1/4/2012 0:00
1/5/2012 0:00
ETC
There is a relationship created between Date_Dimensions[Date_Value] and Seminar_Events[MarketDateName]
Any help would be very much appreciated.
Kind Regards,
John

If you want a running count on MarketNameDate, you need to create a numeric ranking of that column in a new calculated column in your Events table.
Something like:
Rank = RANKX(ALL(Events), [MarketNameDate], ,1)
You should also add a year calculated column in that table:
Year = YEAR([MarketMinDate])
Once those are in place, this measure should work for you:
MarketCount:=
CALCULATE(
DISTINCTCOUNT(
Events[MarketNameDate]
FILTER(
ALL(Events),
Events[Rank] <= MAX(Events[Rank])
&& Events[Year] = MAX(Events[Year])
Mike, can you check out this thread?
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/a2e22d61-7c32-43f2-900e-d9d6325fa26d/needed-more-answerers?forum=sqlkjpowerpivotforexcel
Thanks!
Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
Small Basic,
Wiki Ninjas,
Wiki)
Answer an interesting question?
Create a wiki article about it!

Similar Messages

  • On my itouch 4th gen, I use imessage and message many people, but sometimes when i send a message the send bar on top will go almost all the way and stop. This will happen for some time and then work later. is there anything to avoid the freezinginsending

    On my itouch 4th gen, I use imessage and message many people, but sometimes when i send a message the send bar on top will go almost all the way and stop. This will happen for some time and then work later. is there anything to avoid the freezing problem while it sends

    See:
    iOS: Troubleshooting Messages
    However, I suspect it is just a tempery network problem beyond your control

  • Safari 8.0.2 does not play any sound (but sound works in other apps).

    Safari 8.0.2 does not play any sound (but sound works in other apps).

    Hi Michaelgst,
    Welcome to the Apple Support Communities!
    I understand that you do not hear sound from Safari on your computer but you do hear sound in other applications. There may be several troubleshooting steps I would suggest to troubleshoot this situation. 
    The first troubleshooting steps I would recommend would be removing any unsupported third-party add-ons. Please use the information and instructions located in the attached article to complete this process. 
    Unsupported third-party add-ons may cause Safari to unexpectedly quit or have performance issues - Apple Support
    Best regards,
    Joe

  • I have an internet connection, but any time I try to get a FaceTime login, I got the "no connection" message

    I have an internet connection, but any time I try to get a FaceTime login, I got the "no connection" message

    Try this: http://support.apple.com/kb/ht1808

  • Does the unlocked iphone 4 works with other networks besides at

    does unlocked iphone 4 works with other network besides at&t like verizon, sprint, and t-mobile ?

    An officially unlocked iphone 4 will work with other GSM networks.  The ONLY major GSM network in the U.S is T-Mobile ( who are being purchased by AT&T). Currently with T-Mobile you will not get 3G service  or visual voicemail with the iphone.

  • My Ipad2 won't turn off.  I've tried the reset method,  holding both buttons down for at least 10 seconds, but this doesn't work. I'm on version 5.1.1 and all other functions work except that I cannot get onto the internet via wi-fi either.  Help ??

    My Ipad2 won't turn off.  I have tried the reset method by holding both buttons down for at least 10 seconds, but this doesn't work.  I can't get onto the internet via wi-fi either (don't have a 3G card fitted).  All other functions seem to be working OK including charging. Not had this problem before, but I recently upgraded software to 5.1.1 so is there a bug in there somewhere?

    Look at last link.
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    Another thing to try - Go into your router security settings and change from WEP to WPA with AES.
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130?tstart=60
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • Face time is not working in my MacBook Pro, not even the video in Skype or Photo Booth

    Since I did some projects on iMovie I can't make the face time capture image work. The built in camera is not working even in Skype, or phot booth. What could be the problem? What can I do to solve it?
    Thank you in advance!

    MacBook Pro  / Mozilla Firefox / Netflix / Silverlight Update solved - DON'T DWNLOAD FROM NETFLIX
    I solved this problem tonight. I have a MacBook Pro with 10.5.8. I know, it's old. But I love my Netflix and I recently noticed that Firefox plays Netflix much better.  Then I suddenly got this message that I needed to download the latest Silverlight - it only takes 30 seconds! - WRONG.   However, after much searching, I finally did the steps in order and it worked.  
    This was after repeatedly downloading Silverlight from the Netflix site without success.  So here's what I did:
    1. Went to http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx
    2. Followed the directions. I felt like such an idiot for not doing it right before.
    3. Go to your hard drive and search for "Silverlight" to locate ANY existing Silverlight files: .dmg, etc.
        [also check your Libary/ Internet Plug-ins, but the above search is faster]
    4. Drag it all to the trash and empty it.
    5. Go back to the Get  Silverlight page and click on the Install on that page, not the Netflix site.
    6. Note the steps for Safari or Mozilla Firefox - I wanted Firefox, so I follwed those instructions.
    7. Once it's installed, close all the browsers and Restart that bad boy. Right away.
    8. Open a browser, go to Netflix and proceed to joyfully rot your brain with Netflix content. Yay!

  • Working with Binary data from the Gpib Read Function

    I m using the gpib read command to recieve data from a gpib instrument. I already know the form of the binary data being sent back. I have programmed it in matlab before. I am haveing trouble parseing out the binary data I recieve. the basic form of the data is
    #I immediately followed by 401 64 bit ieee floating point numbers. When I programmed this in matlab the code I used was of the form:
    [a,count,msg]=fread(g2,2,'int8');
    [a,count,msg]=fread(g2,401,'float64');
    for those that don't know matlab code the command reads data from the instrument pointed to by the g2 handle. the number after the g2 above speicifies the number of values to read. And the last part the string in qoute specifies the way the binary data
    is to be interepeted. the output arguments a count and msg are
    a-your data
    count-number of items succesfully read in
    msg-error message
    In the above two lines I use the variable a twice to capture the data. The first time a is set equal to '#I' everything inside the qoutes. The second time a is set equal to the actual data, in this case 401 64bit floating point numbers. I m convince that the flatten to string and unflatten from string function are the set meant to accomplish this task. But I haven't been able to find a good example of how to use these functions. Especially with an array.
    Can some one please help me?
    Thanks
    Scourched

    I'm pretty sure what you're describing is a simple typecast in LabVIEW. You will want to strip off the #I first, using string manipulation functions. Then, you can wire the string into a "typecast" VI, and wire a double precision float constant to the top connector of the typecast (this tells the VI that you expect a 64 bit float output) and then you can read your resulting array of double precision floats on the output of the typecast. The typecast VI is found in All Functions >> Advanced >> Data Manipulation.
    I've attached an example in LabVIEW 7.0 and also 7.1 format.
    Scott B.
    Applications Engineer
    National Instruments
    Attachments:
    typecast.vi ‏11 KB
    typecast.vi ‏13 KB

  • I have ios 7 and lately when im turning off cellular data for some apps when i leave settings and go back in they have turned on back again by themselves. It appears as if i cant turn off cellular data for the apps i want. Any tips?

    I have ios 7 and lately when i go to settings-cellular and try to turn off cellular data for some apps it doesnt work. As i turn off cellular data for one app immideately after i exit settings and re-enter settings cellular data for that same app goes back on again by itself. That happens for most of my apps and is reqlly annoying. Whats more annoying is that when i am not using wifi even though the settings for cellular data for safari or facebook or some other app are turned on (since i cant turn them off as i mentioned) i get the message that cellular data is turned off for this app and i cant use the internet at all on cellular data. I have reset to factory settings and restored from backup and the problem persists. Is there some help or tips you can offer me?

    Did you get anywhere with this? I'm considering wiping it and setting it up as a new device.

  • Allt he links in the header of any websites are not working, I reinstalled fiorefix and it s the same. No problem in others browser. the tool bar is working but not the link sinside the web page located between the top 300px height

    all the links in the header of any websites are not working, the cursor is not changing into pointer and no way to click on any link located at the top of any website page. I reinstalled firefox and it s the same. No problem in others browser. the tool bar is working but not the links inside any web page located between the top 300px height.
    So I can t tlog into any website, i cant write an email as the compose button is located in the top of the page.. Please help, i have all my bookmarks into my firefox...

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Youtube, twitter, facebook doesnt work on my mac (10.4.11). It works on other networks, at the same time, these sites works on other laptops in this network

    Yutube, twitter, facebook doesnt work on my mac (10.4.11).
    I checked my mac with other networks, it worked.
    I complained to my network provider, but to my surprise, these sites
    works on other systems (HP/DEL etc) on my network but
    it doesnt open on my Mac pro.
    I wonder what the reason could be.

    I'm running v10.4.11 on an older Mac laptop with Safari 4.1.3 installed and no problems accessing those sites. Click your Apple menu / Software Update just in case there's an update available.
    Check Safari / Preferences - Security. Make sure Java is enabled.
    Cookies could also be a culprit. Back to Safari / Preferences - Security. Click: Show Cookies.
    Delete the YouTube, Twitter, and FB cookies. Quit then relaunch Safari.
    If it's not cookies, try uninstalling then reinstalling the Flash plugin which is required for all three sites.
    Instructions here  >  Troubleshoot Flash Player | Mac OS

  • Query - Get data from the same table and field two times on a single line

    I have prepared a query showing the bill of material. At each line each component will be a new line and I want to have the description of the material at the top (the master material composed of the component ones) and also the description of the component materials on the same line. This means that I should be able to use MAKT table 2 times on a single line of the query. I have used the query tool with SQ01 and SQ02 tcodes. How can I get the the description of the material at the top and also the description of the component material on a single line?
    Thanks in advance for the answers.

    Yasar,
    Any time you wish to use a table twice in an SQ01 query, you have to create an alias.
    SQ02 > select the infoset, 'change' > go to Join definitions.
    Select 'Alias' button.  Create. Select your table name (such as MAKT) and define an alias, such as 'COMP_MAKT' for component descriptions.
    Now you can insert the Alias table into your infoset just like it was a regular table, and use standard join method to join COMP_MAKT to your component material number.
    Best regards,
    DB49

  • Date function to pull back dates of the year?

    is there a built in function for returning all dates (whatever format) between to dates ?
    Example:
    Select functionname('2009/06/01', 'yyyy/mm/dd), ('2009/06/05', 'yyyy/mm/dd')
    from dual
    Wanted results
    2009/06/02
    2009/06/03
    2009/06/04

    Hi,
    user11210446 wrote:
    Here is what I'm trying to do,
    There is a start date and an end date. I have US holidays for current year in a table so for example christmas 12/25/2009
    I want to show dates between the start date and end date, and if there is a holiday on that date it will not show.
    make sense
    so if a user puts 12/23/2009 for start and 12/29/2009
    it would show
    12/24/2009
    12/26/2009
    12/27/2009
    12/28/2009Yes, that's very clear.
    I would actually do that with a NOT IN sub-query
    SELECT  TO_DATE ('&start_date', 'MM/DD/YYYY') + LEVEL - 1
    FROM     dual
    WHERE   TO_DATE ('&start_date', 'MM/DD/YYYY') + LEVEL - 1 NOT IN
            SELECT  appropriate_column
            FROM    holiday
    CONNECT BY LEVEL <= 1 + (TO_DATE ('&end_date', 'MM/DD/YYYY') - TO_DATE ('&start_date', 'MM/DD/YYYY'));where &start_date and &end_date are substitution variables in MM/DD/YYYY format. You could use bind variables just as well.
    This assumes the DATEs in holdiay are all midnight. If not, use TRUNC (appropriate_column).
    Edited by: Frank Kulash on Jun 4, 2009 12:59 PM
    There's nothing like clicking that "Save" button to give you better ideas!
    MINUS is a little simpler than NOT IN:
    SELECT  TO_DATE ('&start_date', 'MM/DD/YYYY') + LEVEL - 1
    FROM     dual
    CONNECT BY LEVEL <= 1 + (TO_DATE ('&end_date', 'MM/DD/YYYY') - TO_DATE ('&start_date', 'MM/DD/YYYY'));
    MINUS
    SELECT  appropriate_column     -- or TRUNC (appropriate_column)
    FROM    holiday
    ORDER BY 1;

  • Average time between diferrent dates in the same table

    I am having a big problem trying to get this sentence for my report the thing is that I have a table name ca_parking
    ca_parking (
    id_parking number,
    date_in date,
    date_out date,
    id_truck number,
    id_user_rec number,
    date_rec date);
    where date_in and date_out are the day and time where truck get in and out of the building, id_parking is the pk of the table, id_truck is the fk from table ca_truck, id_user_rec is the user who enters the data on the system, anda date_rec is the date when the record is inserted.The company asked for an average of time spent by the trucks inside the parking lots so i need to use the date_in from one record less the date out from the next record of the same truck
    id_parking date_in date_out id_truck id_user_rec date_rec
    451794     03/07/2012 8:50:00     02/07/2012 20:00:00     36937     MFUERTE     02/07/2012 20:08:16
    452580     05/07/2012 7:00:00     04/07/2012 20:15:00     36937     VCONTRERAS 04/07/2012 13:56:33
    451591     02/07/2012 18:00:00     02/07/2012 13:00:00     47393     OVILLACIS     02/07/2012 13:39:40
    451824     03/07/2012 17:00:00     03/07/2012 7:00:00     47393     OVILLACIS     03/07/2012 7:06:37
    453160     05/07/2012 17:00:00     05/07/2012 14:50:00     47393     WALEMA     05/07/2012 14:57:51
    So i need to do something like this
    select avg(ca_parking.date_in - ca_parking.date_out), ca_trucks.trcuk_alias from ca_parking, ca_trucks where ca_parking.id_truck = ca_trucks.id_truck
    group by ca_trucks.trcuk_alias
    but i get only trash
    I need it to do this for truck 36937 { (04/07/2012 20:15:00 - 03/07/2012 8:50:00) + (sysdate-05/07/2012 7:00:00)}/2 = 4.37
    and fro truck 47393 { (03/07/2012 7:00:00 -  02/07/2012 18:00:00) + (05/07/2012 14:50:00 - 03/07/2012 17:00:00) + (sysdate - 05/07/2012 17:00:00)}/2 = 4.65
    how can i get the following date_out less the previews date_in

    I am having a big problem trying to get this sentence for my report the thing is that I have a table name ca_parking
    ca_parking (
    id_parking number,
    date_in date,
    date_out date,
    id_truck number,
    id_user_rec number,
    date_rec date);
    where date_in and date_out are the day and time where truck get in and out of the building, id_parking is the pk of the table, id_truck is the fk from table ca_truck, id_user_rec is the user who enters the data on the system, anda date_rec is the date when the record is inserted.The company asked for an average of time spent by the trucks inside the parking lots so i need to use the date_in from one record less the date out from the next record of the same truck
    id_parking date_in date_out id_truck id_user_rec date_rec
    451794     03/07/2012 8:50:00     02/07/2012 20:00:00     36937     MFUERTE     02/07/2012 20:08:16
    452580     05/07/2012 7:00:00     04/07/2012 20:15:00     36937     VCONTRERAS 04/07/2012 13:56:33
    451591     02/07/2012 18:00:00     02/07/2012 13:00:00     47393     OVILLACIS     02/07/2012 13:39:40
    451824     03/07/2012 17:00:00     03/07/2012 7:00:00     47393     OVILLACIS     03/07/2012 7:06:37
    453160     05/07/2012 17:00:00     05/07/2012 14:50:00     47393     WALEMA     05/07/2012 14:57:51
    So i need to do something like this
    select avg(ca_parking.date_in - ca_parking.date_out), ca_trucks.trcuk_alias from ca_parking, ca_trucks where ca_parking.id_truck = ca_trucks.id_truck
    group by ca_trucks.trcuk_alias
    but i get only trash
    I need it to do this for truck 36937 { (04/07/2012 20:15:00 - 03/07/2012 8:50:00) + (sysdate-05/07/2012 7:00:00)}/2 = 4.37
    and fro truck 47393 { (03/07/2012 7:00:00 -  02/07/2012 18:00:00) + (05/07/2012 14:50:00 - 03/07/2012 17:00:00) + (sysdate - 05/07/2012 17:00:00)}/2 = 4.65
    how can i get the following date_out less the previews date_in

  • How can we turn on/turn off diagnostic data to the App Developers?

    Hi, we all know when you launch an app say Apple Maps or Google Drive, it will ask you a question like, "Would you like to send anoumous data to (the app developer) to help us improving the customer experience?"
    So, some of us decided to turn it off/on when we see the message, but it is not clear to me how we can reverse the decision later on.
    Anyone can help? Do we have such option? Thanks.

    Yes. You can assign individual audio tracks in the same way as you would do with language versions.
    The user manual explains it clearly.

Maybe you are looking for

  • Bootcamp 3.1 (64 bits) can't be installed on Bootcamp 3.0 (32 bits)

    I installed without problems Windows 7 (64 bits) on my iMac and everything works properly, except for the printer (not found) and the Magic Mouse. When I try to install the Bootcamp 3.1 (64 bits) in Windows, I get the message "You have to install Boo

  • Error when launching Flex Builder 3

    Hello, I'm new to flex and just downloaded the trial version of Flex Builder 3. When launching the builder, I get the following error in the log. What am I missing? !SESSION 2008-12-07 21:08:26.880 eclipse.buildId=unknown java.version=1.5.0_11 java.v

  • PC connecting to Xserve 10.5.8

    When I try to connect to my xserve from a pc the login shows up as Machine/User. I only have user names setup on the server. Is there something I need to change on the PC or on the Xserve. I am running 10.5.8. I can turn on allow guest to get around

  • Table's  Properties "row color"[standard;alternating;trans.] doesn't work?

    Table's  Properties "row color"[standard;alternating;transparent] doesn't work? Upgraded VC to 7.01 with sp1, the table's grid color not change with the row color set. But set the nested  iview to show on the layer,the "row color" worked. But Why? wh

  • How to merge theme and slideshow

    Hello Guys I need your help on how I can merge theme and slideshow. I am trying to save the slideshow to an external hard-drive where i store my movies without having to burn it. The options I have are:SAVING AS DISC IMAGE and SAVING AS VIDEO TS_FOLD