Why is my line graph falling to 0 after each month and why is there a sudden spike in december? (this is in Tableau) - data-visualization

Revenue month chart of 2011
I am supposed to make line chart to analyse the revenue for each month in a particular year. So what should be done other than this? Is this one right?

The Revenue column is the problem. I believe you want a continuous measure (Sum, Max, Avg etc) while you are now using a continuous dimension.
Remove the Revenue from rows and bring a Sum(Revenue) or similar.

Wrong chart type, and (perhaps) data aggregation issue - you want a bar chart by month, not a line-chart by day.

Related

How to create weekly YoY metric in AWS QuickSight?

I am trying to calculate a sum of a column for a specific calendar week, and want to compare that to the same week in the previous year.
So let's say I have the sum of WK21 for 2020 is 1000 and sum of WK21 in 2019 is 800. The field should return: 200.
Attached is how my dataset looks like.
I would like to sum the credit per WK for each segment, and see how the difference is to the sum of that week for that same segment, in the previous year. Later on I would change the difference to percentDifference, but I assume the main formula is the same.
Is that easy doable?
Tried this (percentDifference) for WoW (in the same year), and it worked using this formula:
percentDifference(sum({credit}),[{wk} ASC],-1,[{year}, industry, segment])
But when trying for weekly YoY the following formula, it didnt work (-52 because 52 weeks in year):
percentDifference(sum({credit}),[{wk} ASC, year ASC],-52,[industry, segment])
PS: for the country, I didnt take that in consideration, as I want to filter for the countries I want later on...
For Year-on-year difference create a calculated field like the following
difference(sum({credit}), [{wk} ASC, {year} ASC], -1, [{Industry}, {Segment}])
For year-on-year percentage difference your calculated field would be
percentDifference(sum({credit}), [{wk} ASC, {year} ASC], -1, [{Industry}, {Segment}])
This is because the lookup index in the function (-1) is based on the sort of the rows (sort order in the square brackets in the function)
Source: percentDifference and difference QuickSight Docs
Try -100 instead of -52. Since the 'wk' field is not a date-defined field, it is probably just considering 'wk' as an int.

How to show last 13 months in X axis based on single slicer selection?

EDIT: As this is an old question, the intended solution is supported by the relative date slicer in Power BI as seen here.
I am building a rolling 13 month net revenue chart and I've came across a requirement to show the last 13 month in x axis based in what month (YYYYMM) the user selected in a YYYYMM slicer.
The chart below is the one I want:
In order to get the intended behaviour, currently I need to select each one of the 13 month in YYYYMM slicer:
Any ideas on how I can get this to work in Power BI so that the user just have to select the base month?
Thanks in advance,
Cristhian.
Let's say you have a table data(date, value).
Add a table datefilter(date) with dates you want to select. Add a slicer by this date.
Add a calculated column to data : date2 = DATEADD('data'[date].[Date],13,MONTH)
Add this measure:
current = IF(AND(
MAX('data'[date]) < MAX('datefilter'[date]),
MAX('data'[date2]) > MAX('datefilter'[date])),1,0)
filter your visualisation by current is 1.

PowerPivot: Aggregating 'SAMEPERIODLASTYEAR' Sales by Year, Qtr etc

I've created a new measure which uses [TotalSales] and 'SAMEPERIODLASTYEAR' to calculate the previous year's sales, see below:
=CALCULATE([TotalSales], SAMEPERIODLASTYEAR(Dates[Date]))
This all works fine if I create a pivot that displays individual dates (e.g. 01/01/2015) and then the new measure 'previous year sales' value next to it. My problem occurs when I want to change the pivot and display previous year sales by year, quarter or month - with any of these options I get no sales value.
I'm using a 'Dates' table which is linked to the Sales table.
Am I right in thinking I can re-aggregate sales in this way? I have seen an error message which says something about not been able to aggregate a non-contiguous value or date.
I've had a good look to see if anyone else has experienced the same problem, but can't see anything. Any guidance would be helpful.
Regards,
Martyn
Yes you can re-aggregate in this way. Your formula is correct would handles the changes to the aggregation level.
I would check that your 'Dates' table is marked as a date table. Ensure that the year, quarter & months are in this date table and not in your Sales table. Make sure that your date table has one record for each day between the beginning of your sales data set and the end. Check behavior in Power View if you are using Excel 2013.

How do I compute an average of calculated averages in MS reportviewer/rdlc?

I've searched here and elsewhere on the web and have not found this exact problem/solution.
I'm building an rdlc report using the MS reportViewer - the report I'm creating is based on an existing spreadsheet where the average price across 6 months is calculated individually for each month, then the average of those prices is calculated as the 6 month period average price. Whether I agree with that methodology or if it's correct is irrelevant, I just need to know how to get an rdlc to do this.
For example:
Month Price1 Price2 Delta
May-12 $31.54 $30.03 $1.51
Jun-12 $36.27 $34.60 $1.67
Jul-12 $44.19 $42.00 $2.19
Aug-12 $38.96 $37.06 $1.90
Sep-12 $36.89 $35.08 $1.81
Oct-12 $35.57 $33.97 $1.60
Average $37.24 $35.46 $1.78
(sorry for the lack of a screen snip, I'm new and the system won't let me post an image...)
I've created a tablix that does the monthly averages computation - I use a group in the table to group the 6 months of data by month (and then hide the hourly price data so you only see the month total row) but I'm stuck on how to calculate the bottom row of the table which is the average of each column. (the average of the averages is not the same as the average of all 6 months of prices from the underlying data - that's what I've learned in this process... IOW, that was my first solution :-) )
What I tried to do to get the average of the averages was give the month total cell a name, MonthlyAvgPrice1, then in the bottom row, used this expression:
Avg(reportitems!MonthlyAvgPrice1.Value)
As I kind of expected, this didn't work, when I try to run the report, it gets a build error saying "The Value expression for the textrun 'Price1PeriodAvg.Paragraphs[0].TextRuns[0]' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers."
Hopfully I've explained this well, does anyone know how to do this?
Thanks!
-JayG
Actually it is not clear from the question that how are you in particular binding the data to the report items, But from the given information what I understand is that you can
Try like this:
Right Click the tablix row and insert a row below
In the cell where you want to have this Average of Averages insert the following expression
=Sum(Fields!Price1.Value)/6
and similarly insert expression =Sum(Fields!Price2.Value)/6 and =Sum(Fields!Delta.Value)/6 in the other cells where you want to display the Averages
Of Course, you will change the Field names Price1,Price2 etc to the fields that you are getting the values from.
HTH

SSRS column and line chart?

Hello I have a simple dataset in SQL that counts meter readings... There are meter readings every day and I would like to SUM the count, display that in a column chart at a daily interval. What I would also like to do is display a cumulative count as a line so 4 orders Monday, 3 orders Tuesday, 5 orders Wednesday 4+3+5 etc. Apparently there is a running total property I read somewhere in SSRS? Does anyone know how to do this? I'm stumped! I currently have a SUM of count as my total value with category group of date read but it does not seem to be displaying properly. Instead of saying 5 orders on tuesday, it is just showing 1,1,1,1,1 etc...
SELECT COUNT(readingId), dateRead
FROM Readings
WHERE (dateRead BETWEEN #StarDate AND #EndDate) AND (webcontactid IS NOT NULL) AND (meter = 1)
GROUP BY Readings.dateRead
I created a bar chart, put dt as Category group, added a fake Series group called g1 (Group by "A"), and used two data fields, one with the expression
=Sum(Fields!NReadings.Value)
and one with the expression
=RunningValue(Fields!NReadings.Value, Sum, "g1")
and set this to appear as a line.
I got this on SSRS 2005, but I hope it helps for 2008. If anyone has a way to do this without creating a fake Series, then please let me know.