How Do I generate Line Graph in PowerBI for the following Data - date

The Data I have looked like the Image below:
I want to create a line Graph,
The x-axis will have the Months (January to June), Y-Axis will have the Tot_QtY.
Considering that the date information is not in a single column but is spread out to multiple columns, How do I make a line chart.
Output I am getting is shown below:
The Output I need would look like this:

your input data is not correct, you need to model it so you get one column with rows of data. Click Edit Queries, this opens query editor.
Click tab Transform, select your columns and click unpivot.
My expectation is that you still need to work a bit more on your data because how the system knows from a column: MayDATE. that you talk about May. The best base data you can have is a column date and a colum value with data.

Related

Function to call the Name of a column in TABLEAU

I have a problem with Tableau.
I have a Dataset with some rows and some columns. I want to write a IFELSE structure where
The IF condition is that the Value of special field(fixed by a row and a column) is equal to the header of a column (it is every time equal to one name(header) of the different columns).
So to summarize: one value is every time equal to the name of a column and to find the column shall be the if-structure
Does someone know if there is a function to call the name (header) of a column? I didn't find it
Here is an small example, in which the Calculated_function choose the right price according to the Barcode. Everything in the first raw, is the header_name of the column below. enter image description here
Best regards
Jonas
You can work like this.
I created a sample dataset as given by you
Step-1: Connected With data in tableau. Clicked all columns having price (4 here), pivoted them so that they look like this..
Step_2: Create calculated_field like this
if [Barcode] = [Barcode_c]
then [Price] END
Step3: Filtered out null values from calculatedField and got a view like this which can be tweaked as per liking.

Converting a measure to date for line chart in Tableau

I am trying to convert some measures that I have into dates for making a line chart. This is the data I have.
[
I am trying to make a line chart out of this data. But I cannot put it under a date since there are no dates in the dimensions. Any help would be appreciated.
You will need to some how reshape this data to create a single date field. You can do that out of Tableau or perhaps use Tableau prep. Your underlying data source is likely to drive that decision, you don't mention anything about that in your question.
Edit from comments:
Connect to the spreadsheet in Tableau. In the Data Source window, where it shows you all of the data in a table, select the 4 fields starting with Tuition and Fees. Then click on the drop down and Pivot those fields.
That will create 2 new fields, Pivot Field Names and Pivot Field Values.
In your workbook create 2 new calculated fields:
[FeeYear]: LEFT(RIGHT([Pivot Field Names],7),4)
and
[FeeDate]: MAKEDATE(INT([FeeYear]),1,1)
You can use FeeDate as the x axis of your line chart. Pivot Field Values is the measure to use in your line chart.

How to split data into rows

Hi I want to split one data columns by ";" and add it into rows. I believe in tableau this is called pivoting. But it wont work for me.
I have no issues splitting the data by delimiter, but it add's as column and not row. I don't get the option of pivoting afterwards, it could be due its a 'caulculated' field?
This one is not so easy, but let's get through this:
This is my sample data:
ID is still a number, I convert it to a dimension later.
Now, instead of creating a calculated field you do a custom split on your data, just like shown below. In the window that opens up you insert your seperator, which is ";" and the number of columns you need, which seems to be 10 in your case. I choose 3.
Then you create a table like this one:
and go on to create a crosstable like this:
then you klick on data and then paste. You'll now get a crosstable in a new sheet.
Now proceed by right-clicking on the newly created data source,
select the three Country-Split-columns, choose one to click on the arrow and click pivot. No you can delete the Country-Split-columns and you get this:
I think this might be what you want.

Group by first two characters of column, in Tableau?

I'm using Tableau Desktop v9.0. I have data that looks like this:
code,items
02050252,7
03040620,19
03060423,3
I want to create a bar chart of the items grouped by the first two characters of the code field.
So effectively a chart that shows this underlying data:
new_code,items
02,7
03,22
Is it possible to do this within Tableau? Or do I need to group the data manually myself first?
You can definitely do this within Tableau.
Make sure that your code column is a string. If it's not, right click on it in the dimensions section and choose Change Data Type.
Then, create a calculated field (Analysis -> Create Calculated Field) and enter the expression LEFT([Code], 2), which will take the first two characters of the code field.
Drag your new_code field to the Rows shelf and Items to the Columns shelf and voila, you have your desired data. You can of course change the type of the chart, make it a table, etc. from here.

Push all data fields to the top of a Details band inside a report

I need to push all data from different rows to the top, everything at the same level.
I have this data, each one with a diferent day name on it, and I draw them on different 'columns' in my report.
Problem is that data for the first column gets at the top of the report, and data for the second column gets below them at the 2nd column. And so forth.
I wish to have something like this:
MONDAY TUESDAY WEDNESDAY ...
-------------------------------------
Hello World Here I Am
There More Data Sample Data
But I'm getting t his:
MONDAY TUESDAY WEDNESDAY ...
-------------------------------------
Hello
There
World
More Data
Here I Am
Sample Data
I'm looking for the correct combination of options at the propoerties of each data field, but couldn't get it to work.
I also have tried getting all the data fields inside a Frame and playing around with the Fram properties too, but no success yet.
Anyone knows how to achieve this?
EDIT:
right now, my data fields have a Print When Expression on each 'column', so that they draw themselves on the right column, according to the day they belong to
Your data is displayed on different rows, because each row corresponds to a row from the result set. You can control this behaviour using a report property called Print Order. In your case, it is set to Vertical. If you change to Horizontal, then each column in your report will correspond to one row in your result set.
You can find some useful tips here and here.