Can someone provide the logic for "selecting all the birthdays that occured within the last 90 days"? [closed] - excel-formula

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 months ago.
Improve this question
edited*
I'm currently using Microsoft Power BI
Can someone provide the logic for "selecting all the birthdays that occured within the last 90 days relative to today's date"?
For example:
I have a table called "ClientTable" with the birthdays of 100 clients in an MM/DD/YYYY format. Today's date is 09/15/2022. I now want to list out all the of the clients that had a birthday within the last 90 days. So essentially, I am looking for a list of all the clients that had a birthday between 06/15/2022 and 09/15/2022.
This is how I attempted to solve it:
I first parsed out the Month and Day components of the BirthDate field into two separate columns. I then created a new table called "MasterDay" with all the dates in a single year and also parsed out the Month and Date components into separate columns:
MasterDate
Date
Month
Day
DD/MM/YYYY
MM
DD
DD/MM/YYYY
MM
DD
ClientTable
BirthDate
Month
Day
ClientID
DD/MM/YYYY
MM
DD
85
DD/MM/YYYY
MM
DD
7
I then created a relationship between the two tables "ClientTable" and "MasterDay" on their respective month and day columns. So that when placing the complete "Date" column from the MasterDay table into a slicer it would select all the corresponding rows from the "BirthDate" column in ClientDate table.
The issue I'm having is that when slicing for a range that begins in the middle of a particular month, say between 06/15/2022 and 09/15/2022, it picks up all of the birthdates in the months of June and September like 06/07/2022 or 09/23/2022 despite it not being included in the slicing range.
Thanks, G

In Power BI you would simply use a Relative Date Slicer or Filter.

Related

How to create a 'past 3 months' time period in Google Data Studio

I'm trying to have my line chart show data for the past 3 months. GDS has a 'last quarter' date range, but this shows me Q1, Q2, Q3, or Q4. What I need is the data for the past 3 full months (not counting the current month). I tried creating a calculated field but the documentation isn't proving very useful for the matter at hand.
eg. If the current date is Feb-20, I want to show data from 'Nov 1 - Jan 31'. Also need to compare to same period from last year.
Can anyone help? Thanks in advance!
I don't think this is possible in the way you're describing. You can achieve the same by creating a metric in your data source and then applying a filter at the page / chart / report level to remove data which doesn't meet your criteria
You can use the option "advanced" in the date dropdown and set the start date to today minus 3 months.

Spotfire Bargraph to show Avg Quality by year for previous years and by month for current year

I have a bargraph which shows the quality of my data for each month. As the data is growing over the years, the graph is getting messy. So, i would like to show Avg Quality by year for all those months in Previous years but monthly for the current year.
Can any one help me how to achieve this.
Thanks,
-Dileep
This needs to be separated into two charts, or it just won't be legible. I'd suggest:
Creating an AVG by Year bar chart graph for all your data
Creating a details visualization of the above Yearly Average data which shows the 12 months of that year with SUM() as your aggregation method. Be sure to have YEAR > Month on your category axis
Thus, if you need to compare 1, 2, 3 or all the years by month you can select them all, or just the ones you want.
I was able to do it with the help of some calculated columns. To help explain, let's assume the value column in your data set is called Value and the date column in your data set is called ValueDate. I created some fictional data that extends into April, 2017 to help illustrate the solution.
Insert a calculated column to classify whether or not the date in each row is in the current year or not. I'm going to call the column DateGrouping.
CASE WHEN Year(DateTimeNow())=Year([ValueDate]) THEN "Monthly" WHEN Year(DateTimeNow())>Year([ValueDate]) THEN "Yearly" END AS [DateGrouping]
Insert a calculated column that tells us the last date of the month for ValueDate. E.g., if the date in the row is 4/10/2015, the last day of the month for the day in that row is 4/30/2015. If the date in the row is 7/8/2013, the last day of the month for the date in that row is 7/31/2013. We'll call this column LastDateOfMonth.
DateAdd("day",-1,date(Year([ValueDate]),Month(DateAdd("month",1,[ValueDate])),1))
Insert a calculated column that tells us the last date of the year for ValueDate. Of course, it's just Dec. 31 of ValueDate's year. Call this column LastDateOfYear.
Date(Year([ValueDate]),12,31)
Finally, we utilize the previous three calculated columns to add a calculated column for the date value we want to plot. You are wanting to plot by month for the current year, and by year for prior years.
CASE [DateGrouping] WHEN "Monthly" THEN [LastDayOfMonth] WHEN "Yearly" THEN [LastDateOfYear] END
On my value axis is the Value column, which I'm aggregating as an Average. On my category axis is the calculated DatePlot column -- I set the category axis to Categorical Scale. And I'm coloring by the calculated DateGrouping column to offer a visual cue that the data is aggregated differently over time.
Now, should this be done? There are certainly some pitfalls. You can't make the category axis Continuous Scale or else you'll see all the empty months when we're lumping prior years into Dec. 31. On the other hand, gaps are good visually when there is no data for a given period. So I don't know. But I pictured what you were asking and decided to try it. Buyer beware!

Time series mock data generation for 16 years of quarterly data in Excel or Matlab

I would like to generate a mock time series quarterly dataset from, say, 2000-2016 for a variable (quarterly credit growth) that averages around a certain value (say, 30%). Can anyone give a suggestion on how to do this in principle?
Edit: what I was implying were the actual data values for each time period, i.e. data with a certain mean and variance.
Found a solution with a code in Matlab, for anyone interested, see below in answers.
Excel approach:
You can make column A your date list. In A1, or A2 or more if you have header rows, you will have to seed your list by providing the first start date. Lets assume you put your seed date in A2. I would then go about adding 3 month to you start date using a formula, and copy down until you have hit your desired date. In order to add the 3 months I would use the following in A3.
=date(year(A2),Month(A2)+3,day(A1)
that will give you the first day of the month every 3 months. If you want the first day of the month every 3 months, set the day to 1 like so:
=date(year(A2),Month(A2)+3,day(A1)
And end of month could be calculated as:
=eomonth(date(year(A2),Month(A2)+3,day(A1)),0)
however I would prefer to do the end of month calculation based on the row you are in so I would do it more like:
=EOMONTH($A$2,(rows($A$2:A3)-1)*3)

grouping in an excel pivot table with different year end and quartiles

I have a pivot table with a lot of items currently grouped by date into quartiles and then months under that. My question is this, Our Financial year is not Jan to Jan so can I set up quartiles to reflect this? also our financial periods are not simply set months, they follow the months but are always full weeks around that. for example, P1 this year is 04/07/2015 - 07/08/2015. and Q1 would be 04/07/2015 - 02/09/2015.
Aside from manually grouping is there a way to set this up to happen automatically within Excel?
As stated by pnuts in the question's comments:
The most practical way may be to define the quarters (?) in your source data.
If you are at least using a Gregorian calendar, you may want to subtract an offset from your dates (i.e. # of days between 01-Jan-YYYY and DD-MMM-YYYY ... whereby the offset YYYY doesn't need to be the same as your date's YYYY). By this subtraction you get an "ordinal number" of the date within your business year.
[offset] =[FOY]-DATE(YEAR([FOY]),1,1)
So with your year starting on [FOY]=04-Jul-2015, you have an offset of of 184 days and a normalized date of
[date_normalized] = [current_date]-[offset]
So 04-Jul-2015 will be shrunk to 01-Jan-2015. Now the quarter easily calculates to
=CEILING(MONTH([date_normalized])/3,1)
... or =VALUE(MID("111222333444",MONTH([date_normalized]),1)) ... if you prefer
For your not-quite-months always being full weeks, I suggest to calculate a week number by
=MOD(CEILING(([date_normalized]+1)/7,1)-1,52)+1
to create a weekly reporting period 1 .. 52. With a further =CEILING(.../4,1) this can be converted to quasi-months having 4 weeks each.

Filtering SharePoint list by current month

I didn't found some similar question for my problem, so I would be much grateful if someone help me.
I have SharePoint List with couple of different of type columns ( number, date time, text,look up etc).
Columns that will be used for filtering:
Month Started ( number that represent the month when the item was created - number field - example: 1,2,3..12 )
Today's Date ( represent the current date as date field (date only) - example: 10/1/2014 )
So, my question is ,how can I take the month from the Today's Date column , represent as a number and use for filtering the Month Started column.
If the question is not understandable please write a comment.
Thanks in advance!
You can create a calculated column to extract the month. This is how I do it:
=IF(ISBLANK([Submitted Date]),"TBD",CHOOSE(MONTH([Submitted Date]),"01. January","02. February","03. March","03. April","05.
May","06. June","07. July","08. August","09. September","10.
October","11. November","12. December"))

Resources