Forum Discussion

yummy's avatar
yummy
Regular Visitor
1 year ago

Linechart - Plot data as lines over categories

Dear Comunity, i'm new at using power bi and i would appreciate if someone could please help me configuring a line chart or scatter plot visual in power bi. I have a table with color measurement data. Each row includes the name of the measured sample, followed by the measured reflectance power at a list of wavelength of the radiation (380 - 730nm, 10nm Steps). I would like to create a line/curve plot showing the spectral reflectance of each sample over the wavelengths.  In Excel this is quite simple using a point plot. I tried a while by myself but did not manage to create such a simple plot in power bi. Could someone please explain me what i need to do to create such a plot in a power bi.

 

Thanks in advance - Christoph

 

SAMPLE_NAME380390400410420430440450460470480490500
A10.067155230.075148430.085613760.093677880.100764090.101138560.100297490.09785430.095586880.094166410.09531880.105669260.12481427
B10.066740390.075264080.0881120.09706410.103641060.103449480.102473260.100037510.097484590.095797060.096435880.106335580.12543806
C10.06714810.075858690.088076530.096849680.103767040.103850860.103140850.100706520.098077720.096193050.096708340.106566050.12584065

 

 

4 Replies

  • Hi yummy 

     

    after uploading data in power bi you need to go transform data>> transform >> unpivot, use this option to change the structure of your data. it should sth like this:

    Sample nameradiationvalue
    A13800.06715523
    ...  

     

    then you just need to use line chart. add radion to X-axis. sample_name to legend and value to y_axis

     

    If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

     

    • yummy's avatar
      yummy
      Regular Visitor

      Hi Selva-Salimi , thank you very mutch for your response...and yes changing data structure as described by you will work.
      The "issue" is...there are more than 5000 measured samples in each file. Unpivoting will increase the amount of records for one file from 5000 to 170000. Thus i would really prefer to keep the structure as is.

      Do you see an other solution not making it necessary to change the structure of the data? E.g. in excel one can simply switch rows/columns directly in the configuration of the line chart to make it work.
      Isn't there something similar in PowerBI?

      Thank you - Rgds Christoph

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi yummy ,

        If your data model looks like this:

         

        I'm sorry, you may have to unpivot it first. Because Power BI processes data in columns, you cannot directly put the content of a row into a visual object, nor can you directly transform the data of a row.
        That is to say, the three parts I circled in red in the figure below must appear in your data as columns, otherwise you cannot create this visual object


        Best Regards,
        Dino Tao