Obtain earliest date from a table according to summary value - powerbi-desktop

I have a table as follows, which has a category and some dates
I want to get (i) the earliest date for each category and (ii) the latest date from the category. Basically Im trying to get a Gantt chart visual between the two dates, based on the name
For example, alpha would run from 3May22 to 3 Aug22 on the chart since that effectively the start and end date of the category
I tried to drag my columns into the Gantt chart but I end up with a bunch of rows for each task (e.g. alpha, alpha, alpha) while I want to have the start date from the earliest alpha and the end date from the oldest alpha in one line.
Not sure if I need a measure (I think so) or a new column but I'm a bit stuck
Any help would be appreciated :)
Thanks,
Matthew

Actually, I found it, hopefully of use to someone else in the same boat.
PowerBI allows you to group the categories together under the visuals edit tab
I clicked that and suddenly everything looked good!

Related

Spotfire: count number of occurrences based on other columns data

I'm struggling with calculating new columns as I'm still new to Spotfire.
I am given two Date columns (format: mm/dd/yyyy), one is "Created" and the other is "Closed" as shown below in the left two columns.
The end goal is to have two new columns (shown above in right two columns):
1. Date column with daily interval (format: mm/dd/yyyy)
2. Number of occurrences that where open on that day based on all rows in the "Created" and "Closed" columns
Hopefully this makes sense, please let me know if it does not. I really appreciate the help and look forward to learning - thanks!
It seems like you are trying to add records with a calculation, which is not possible. Spotfire will only work with the data that is there.
You'll need to start with a table that has one record per day.

Excel 2016 VBA Display every nth Data Label on Chart

I have a line chart that displays the revenue of multiple airlines, throughout the period of 2011 to 2016 - with data points plotted quarterly (Q1-Q4, for each year) on the X-axis
I would like to only show the data labels (on the chart) for Q4 of each year, for each airline. I would like to do this and keep the axis as is.
Any suggestions will be much appreciated,
Thank you!
(I have Excel 2016)
Your question didn't express clearly if you want to add the labels by means of a VBA macro.
I suggest to do following:
Dim sData as Series
For i = 1 to sData.Points.Count Step 4
sData.Points(i).ApplyDataLabels
Next i
Note that if there is not value for the Point i in the series, the label seems not to be displayed. It took a while to find out why a label was not added to the chart. To detect this case, I wrote following test:
If sData.Points(i).HasDataLabel Then
If Len(sData.Points(i).DataLabel.Text) = 0 Then
...
End If
End IF
Searching a little in the web (around 3 minutes, that maybe you should spend the same time) found this article:
http://www.cs.mun.ca/~n39smm/Excel/Data%20Label.pdf
This is the resume, but I suggest to view the document because have a lot of graphics.
Click on the bar you want to labeled twice before Add Data Labels.
Click on the label, then right click and select Format Data Labels.
Check the Category Name and uncheck Value.
A little research before asking can save you a lot of time.

Creating bar graph of event occurrences for each month of several years in excel

I have a long list of dates (about 2000) in an excel spreadsheet and I want to see how many of these dates lie within particular years (and roughly which part of the year also if possible). I know how to make basic graphs in excel, but I'm not sure how to make a bar graph that uses dates. Any suggestions?
I can obviously split events in day, month, and year and then use count to count the amount of each year, but this would not show the placement of the event within the year in the final graph.
20/03/2000
2/04/2000
3/04/2000
26/05/2000
7/06/2000
20/06/2000
22/06/2000
10/07/2000
12/07/2000
22/07/2000
2/08/2000
8/08/2000
11/08/2000
14/08/2000
15/08/2000
12/09/2000
15/09/2000
20/09/2000
25/09/2000
2/10/2000
22/10/2000
24/10/2000
25/10/2000
27/10/2000
1/11/2000
10/11/2000
13/11/2000
16/11/2000
18/11/2000
20/11/2000
25/11/2000
27/11/2000
3/12/2000
6/12/2000
20/12/2000
21/12/2000
22/12/2000
4/01/2001
7/01/2001
11/01/2001
24/01/2001
25/01/2001
2/02/2001
4/02/2001
9/02/2001
12/02/2001
13/02/2001
20/02/2001
21/02/2001
2/03/2001
11/04/2001
19/04/2001
20/04/2001
21/04/2001
24/04/2001
27/04/2001
28/04/2001
2/05/2001
3/05/2001
5/05/2001
12/05/2001
13/06/2001
20/06/2001
25/06/2001
3/07/2001
5/07/2001
18/07/2001
20/07/2001
21/07/2001
22/07/2001
25/07/2001
4/08/2001
5/08/2001
9/08/2001
10/08/2001
11/08/2001
12/08/2001
13/08/2001
31/08/2001
11/09/2001
12/09/2001
17/09/2001
3/10/2001
10/10/2001
18/10/2001
21/10/2001
23/10/2001
4/11/2001
5/11/2001
17/11/2001
22/11/2001
23/11/2001
27/11/2001
29/11/2001
3/12/2001
I cannot check this in earlier versions of Excel, but in Excel 2016, if you build a Pivot Table with your data and drop the date in the Rows - you get your data grouped in Years, Quarters, and Months. If you also drop the date into Values, then you get the Count of values in each year, quarter, and month.
Then a pivot chart looks like this ...
A less magical way to do it
Applies to Excel 2013 and up
From your single column of dates, build a pivot table.
Put the date in Rows. Put Count of date in Values.
Select any one of the dates. Right Click and choose "Group...", or choose "Group Selection" from the Analyze ribbon.
Click on each of Months, Quarters, and Years.
Filter how you would like.
Select PivotChart from the Analyze Ribbon.
You can create a scatter graph as suggested in the comment. Consider your data set and see if there is any other quality that could be added to the chart, which could be plotted on the value axis. For example the number of people attending the event, or the duration of the event in seconds, or something like that, so that the graph contains more information. In the following screenshot, the blue dots are just the 1's from column B plotted on the time line. The orange dots plot another data aspect on the vertical axis.
If you create a pivot table of the dates and drag the date into the Sums area you will get a count of each day, make sure this is sorted. Then a chart will show the number of records for each day. You will need to copy and past values from the pivot to a new sheet to be able to make a scatter diagram from the output of the pivot table (in Excel 2010). But once it is a scatter diagram the events will be in the "correct" places.
If you wanted to group it by month instead you could use a formula to create a column of year & month and then do the pivot and chart on that column. For example the formula below will give you 201605 for May 2016.
=YEAR(A2)&RIGHT(100+MONTH(A2),2)
Weeks would be a bit trickier, but I suppose you could divide the date by seven and then INT it to get a 7 day grouping. These wont show the actual events occurance within the period but would let you see which periods have the most events.If you are looking for things like more events at the beginning of the month or something you might need to try different "groupings" like weekly.

Creating a sum based on a category within a date range

I'm trying to make a spreadsheet that I can easily take an export from Mint.com's CSV outputs and get them into my Excel budget.
To do so, I need a way to populate each field within a date range. I'd like to avoid macros if possible (I don't know how to make them).
I'm happy to share my finished .xls with the public!
I've imported Mint.com's data in a manner that has column S for the date (3/30), column V with the cash value that I need to add up, and column X for the spending category.
I need to tally each month's spending ($V) by category (column X).
Through research, I devised this (for my January "Gas & Fuel" spending):
=SUMIFS($W$2:$W$900, $T$2:$T$900, ">="&W$12, $T$2:$T$900, "<"&(EOMONTH(D$1,0)+1), $Y$2:$Y$900, "="&$B5)
However, it required that I reformat my Dates, which is an issue because this would become specific to each year and I would need to change the fields every year. I'd like the document to be usable without adjustment using my spending data from the past and future.
Is there a way to take the year out of the equation? To make that formula above work, I renamed my column from "January" to "1/14".
Here is what the spreadsheet looks like
Thanks!
A pivot table would work best with that data.
Initial set up would show each day separately, but by using Grouping
(here) ^^^
you can group the data by month/day/year/however

Can I display daily data in month buckets using only excel's chart formatting?

I have daily sales figures that I'd like to plot on a simple linegraph.
I would like them to be shown in monthly buckets (i.e. if I sold 5€ on Jan 01 and 10€ on Jan 24, I would like to see only one data point for January with 15€ in it).
Please note that I don't want to use any supporting formula/VBA script, I want to do this using only chart formatting.
I tried setting the chart's X-axis type to "date axis" and I chose "months" as the base unit.
This almost works, but the line graph ends up being kind of weird. Changing the chart type to histogram doesn't help much either. The individual sales are not "piled up" like I would but, instead, they're hidden one behind the other. Stacked histogram doesn't work either.
Any clue on how I can force excel to bucketize my data using only chart formatting? This can't be that hard...
Try creating a pivot chart, then grouping the dates by month (right-click a date in the pivot table, and click "Group by... Month".
If you want to group by Years as well - hold down the Ctrl Key whilst you select the Month (both categories will then show up)

Resources