Forum Discussion

helger's avatar
helger
New Member
10 years ago
Solved

Sorting and visualizing data

1. My table looks something like this

 

temp1   names min right-now max

temp10   name1 6    7              13

temp11 name2  9    10          53

temp2    ....       12    14       35

temp3

temp4

Problem here is that temp is wrong, it should go from 1 to 10, but program does it other way, 1,10,11,2,3,4,5,6,7,8,9

 

Is there someway i could fix this? so that numbers would go from 1 to 10? (temp) If i try sorting, it just changes 1 and 9 (up or down)

 

2.

  Kuupäev            Temp1  Temp2   Temp3 Temp4 Temp5  Temp6   Temp7    Temp8  Temp9 Temp10 Temp11

06.Oct/201523°C-21°C5°C8°C5°C6°C5°C-29°C5°C5°C11°C
05.Oct/201518°C-25°C5°C7°C5°C6°C8°C-28°C4°C5°C8°C
04.Oct/201522°C-20°C6°C9°C4°C4°C8°C-21°C6°C5°C9°C
03.Oct/201524°C-27°C6°C9°C4°C4°C5°C-23°C3°C5°C

5°C

i have this big table, 1 month data, i just picked out latest dates. Is there a way to put this big 1 month data into some kind of graph?

  • Hi helger. I'm not sure exactly what you want the graph to look like, but if you want something where you have a line for each name, your data should look something like this:

     

    Date      Name   Temperature

    1/1/2015  NameA  23

    1/1/2015  NameB  24

    1/2/2015  NameA  25

    1/2/2015  NameB  24

     

    Power BI really works with a columnar storage engine, so each value or attribute should be in its own column. You can do things like max/min/average as calculations on top of this so just storing the raw data is easiest.

     

    Hope that helps!

10 Replies

  • deldersveld's avatar
    deldersveld
    Resident Rockstar

    1. The temp column is sorting as text, where 1, 10, and 11 all are ordered before 2. If the column only contains numbers for temp already, try changing the Data Type to "Whole Number", and the sorting behavior should change to 1, 2, [...] 10, 11. If your data actually has "temp1", "temp10", "temp2"; *one* method would be to use Split Column-->By Delimiter on the Transform tab and use a Custom delimiter = "temp". This will separate the word "temp" from the actual number, and you can remove the extra column created. There are other ways to parse the text too.

     

    2. The table data would likely plot on a graph better if it were unpivoted so that the data for the separate Temp1, Temp2, etc. columns are all in one value column. On the Transform tab, highlight the various "Temp" columns and click "Unpivot Columns". This will create two new columns for "Attribute" and "Values" where Attribute will contain the former column names and Values contains the temp data. Once the data is in this format, trying plotting it.

    • helger's avatar
      helger
      New Member

      First part is fixed now, thanks

       

      Second, not much, i did as u said, made attribute and Values on all of the temps, so i have like 10 values and attributes

      But still putting them into graph seems to be the hard part, for me right now at least. I am trying to put them in Line chart and in Fields, i put the dates to axis, the attribute to legend and count of value to...value. But i get one straight line with the value of 1(count of value)=How to i change this to just value and not count of value?. There is no option next to it, only remove field, count(distinct) and count

       

      • LetBloodline's avatar
        LetBloodline
        Advocate I

        Maybe it's formatted as text so he can't do anything else? Did you check the data type?

  • Or if it is possible change table names. For table names lower than 10 add prefix 0. temp01,temp02... it will order tables in a correct way.