How to plot line graphs with time in Power BI - graph

My table looks something like this:
Location
TimeSlot
Mean Rate
New york
22-02-15 22:00:00
22.40
New york
22-02-15 21:45:00
23.00
New york
22-02-15 21:30:00
22.00
New york
22-02-15 21:45:00
34.00
Basically the signal is every 15 minutes and the data go back 1year+
At the moment I have a line chart that I have done by putting the location, timeslot and mean rate into the field section. This works fine, but Im still getting used to the 'drill down' + 'hierarchy' options, I feel like they dont work very well. They are always summing up my values which makes the plot line inaccurate. I have fixed this by choosing 'maximum' in the field section so that it show the highest value (mean rate) on a given day but this doesn't work as well for month or year.
Also, I don't like that I cant see the entire table in one view, you have to scroll across which can be hard to read when you want to assess trends etc. (Ive added a pic)
enter image description here
So my question, is there a different/better way of getting and displaying this line chart?

When you drop the date into the axis field and Power BI automatically creates a date hierarchy, use the dropdown on the date field and change it from "Date Hierarchy" to "Timeslot", i.e. the field name.
Before
After

Related

% Change to Prior Column

So I have a series of data that the EU would like visualized as a bar chart displaying the % variance to the prior month. They only want the last 4 months. Easy enough. My problem is being a perfectionist I'd like the 4 months displayed BUT you technically need 5 months of data pulled to get 4 months of data and the 5th month has no value displayed because there's nothing to compare it to. Filters of course drop the 5th month's value. I just want it to not show that fifth month.
There are several ways to solve your problem:
Use the Limit Displayed Rows option in the Visualization Settings:
Choose to Hide the First 1 rows with the data of the 5th month being the first row to hide it. Source: Looker docs
Create a custom calculation to exclude that specific row. The calculation should be something like diff_months(${data.created_month},now())!=5. The value should be Yes except for the month you want to exclude. Then click on the Settings wheel next to your calculation's name and select Hide "No"'s from Visualization and Hide from Visualization.
Romain

How to add denominator count (Total sales) for stacked graphs in Tableau

I have built a bar graph using tableau for the following data. How to add Total sales (120,150,200,180,140) on top of the each bar in tableau
[The following image has the data and bar graph that I was trying to build]
[1]: https://i.stack.imgur.com/NdA7s.png
Thanks for your help
Hope this helps.
I pivoted the data first to make it easier by working with a single measure.
Go to the data tab and select the Sale A and Sale B measures:
Then hit the dropdown and select Pivot.
Then your data will look like this
Next, you want to set the fields up like this so it mirrors your screenshot.
The SUM(Pivot Field Values) is a table calculation set up as percent of total calculated Table (down).
Then just duplicate your measure by holding Ctrl and dragging to Rows. Make it a label in the Marks section. This will add the total. You just have to play with the axis and format to get it into the place you want from here.

Date Axis in a Telerik Reports Line Graph

Does anyone know how to set up a date time axis to use DateTime Scale in a line graph in Telerik Reports? I have been trying to figure it out for over a week now. I don't understand why this thing has to be so difficult to use. I started by setting up a line graph.
I have three columns DATE, SALES_COUNT, and SALES_TYPE. I want there to be three lines on the graph. One for each value of SALES_TYPE. I used SALES_TYPE for the series, SALES_COUNT for the value, and since I didn't have any other options left, I used DATE for Categories. I clicked finish and previewed my graph. The graph looked right except I wanted to make a few customization to the DATE axis. Specifically I only wanted it to write out a date label for every 5 ticks or so. There was no way to do this.
Eventually I figured out that I have to set the axis to use DateTime Scale since it defaults to Category Scale. I set it to date time scale and previewed the graph again. I got the error: "X value cannot be null or empty when using DateTimeScale, lineSeries1", so I went to lineSeries1 and set the X value to "= Fields.DATE", and clicked preview. Now the graph nolonger displays any of my data points, and there is only one tick on the DateTime axis and its labeled as 1/1/2015 12:00:00 AM, a DateTime that is not even in my dataset. I have been struggling for over a week now to figure out how to do this simple task. Please help me.
The SQL query I was using was handed to me by the DBA. I never really looked at it, I just stuffed it into the report. It turns out the query was returning the DATE column as a varchar. Once I cast the DATE column as a date in the select column list of the query, Setting the axis to use DateTime Scale worked fine. If anyone else runs into a similar problem, check the return types of your columns.

changing the displayed labels on a tableau liner graph

In my tableau visualization I need to show the change in a metric over every minute for a day.
I have a "minutes" table in my db. Each row has columns: "minute_id", type int
"minute", type string: carries the value of the time eg: "05:33, 12.30, etc"
"min_date_time", type datetime: carries the value of the time datetime equivalent of the above string value eg: "2013-11-01 2:30:00 AM, 2013-11-01 2:31:00 AM, etc"
A second table called "demos" has all the metrics that are shown for that specific minute.It has relevant columns as follows:
"minute_id", type int: foreign key for the minutes table
"ind2plus", type float: value to be displayed on the y axis for each "minute_id"
This is what I have so far:
The problem Im trying to solve is:
On the X axis currently the displayed unit is "minute_id".
I would like to keep minute_id as the values on the X axis,
but I would like to change the values "displayed" as labels on the X axis from
the int value in the "minute_id" column to the string value in the "minute" for every "minute_id".
How do I do that? Please advise.
UPDATED GRAPH:
If you have a true datetime field in your data, you get more flexibility by using that field for most situations.
So I suggest putting your min_date_time field on the columns shelf to replace minute_id.
Tableau allows you to use dates and time fields in many different ways for different effects -- so many options that it can be confusing. You have to choose whether to treat the field as a dimension or measure, whether to treat it as discrete or continuous, and what level of granularity to use (hour, minute, month, exact date ...) It will take experimentation and experience to get comfortable with implications of the different choices.
For your graph, I would start by choosing a continuous dimension at the minute level. You can adjust the settings by clicking the little triangle on the right of the pill on the columns shelf. The truncated date settings are the second batch of date menu options and result in a green pill. Once set, you can drill up/down granularity with the + on the left of the pill.
Finally, once you are happy with your chart, you can change the formatting instructions to affect how dates are displayed on the axis. Right click on a number on the axis, choose format, and then in the format pane, under scale you should see a pull down labelled Dates. You can choose one of the existing date formats or enter a custom one. The format strings are pretty much what you expect.

Flex LineChart advanced horiztonal axis?

I want to make a line chart that allows the user to select a date range for the data. For example if the date range span is more than 1 month, I want to to have a bar that shows the months, also if the date range is around 30 days or less I want it to show the dates for each day as well. Something like that.
Does anyone have any suggestions?
Thanks!
I would suggest using a DateTimeAxis, and setting the labelUnits property to "days" or "months" as appropriate. The axis will then do all the hard work of grouping your data accordingly.
In your particular case, when the user makes a choice from the combo box, you should have a handler that computes how granular to make the x-axis based on the user's date selections.

Resources