Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Graphing data sets with different numbers of rows on same line plot

Hello everybody. I have been trying to find a solution to this problem within PowerBI but I have had no luck. I am trying to create a line chart with many lines where the X axis is time and the Y axis is the values for each data set. Now this is where the problem is, the data is test data that is read from sensors with different read rates. This means that each row does not correspond to the same point in time. Here is an example of how the data looks:

BriceRM_0-1717738909071.png

Each column data set (Time N, Data N) could be a different number of rows than any of the other columns (there are some common read rates). Most of the times start around the same time (within 1-2 seconds at most) and end around the same time, hence the different column lengths with different read rates. 

 

In other programs (python, excel, etc), this is not an issue as I can graph each data pair together on the same graph as everything else (aka each data set is paird like [X Data 1, Y Data 1], [X Data 2, Y Data 2]). However, in PowerBI it seems to assume that every row is related, and so it only allows you to select one thing for the X Data (aka one time column). I am avoiding the use of pre-processing the data outside of excel as I am looking to automate the analysis of new test data (all follows the same format).

 

How can I handle this in PowerBI? 

 

EDIT: 

Data example is in the Github repository: https://github.com/Cycon743/PowerBI_Data_Example.git

Sheet 1 contains an example of the data that I will be handling and sheet 2 contains the data made so that it SHOULD be able to be graphed on the same graph in PowerBI since the data is equivalent row-wise aka there is only one time column. Formatting the data like this doesnt have to be the solution if there is a better way out there.

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

This M code will transform the dataset into a 2 column table

let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Added Custom" = Table.AddColumn(Source, "Custom", each List.Split(Record.ToList(_),2)),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
    Custom1 = List.Transform(#"Removed Other Columns"[Custom], each Table.FromRows(_)),
    #"Converted to Table" = Table.FromList(Custom1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandTableColumn(#"Converted to Table", "Column1", {"Column1", "Column2"}, {"Time", "Date"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"Time", type number}, {"Date", Int64.Type}})
in
    #"Changed Type"

Ashish_Mathur_0-1717974647847.png

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hello Ashish, thank you for your response. Unfortunately this will not work as each of the data sets is different data and needs to be handled seperately. For example, Data 1 could be the voltage of one system, Data 2 could be the mass flow rate of air, Data 3 could be the fuel rate as an example. Therefore, all the data columns cannot be congregated into a single column. 

Hi,

Share data in a format that can be pasted in an MS Excel file.  Show the expected result clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish! Thank you for your reply. I added the file to github, link added to original post. Expected resullt is as described in the original post. The formating of the data doesnt necessarily matter AS LONG AS a graph can be made in which all the data is graphed on one line chart correctly. PowerBI graphs data assuming that a row is consistent across columns (aka, the data row-wise is related to the X-Data column's value in that row), and the current state of the data does not satisfy this. 

 

BriceRM

lucadelicio
Super User
Super User

Hi @Brice,

the only way is to create a correct dataset to analyze.
You need a single table in wich you have all the attributes.

The only way that i find is to crete manualy with power quey the n table to append to create the dataset.
Ceate a correct dataset for every item:

lucadelicio_0-1717941689886.png
Append every Item in a total dataset:

lucadelicio_1-1717941727386.png

Now you can do your analisys correctly:

lucadelicio_2-1717941761739.png

 

If you are able to arrive to a complete and correct dataset automatically then you can analyze with powerbi.

As attachments the pbix file!

I hope i'll help you.

 



Luca D'Elicio

LinkedIn Profile
Anonymous
Not applicable

Hi Luca, Thank you for your reply! This is what I am looking for but I am unsure on how to do this. Could you please explain the steps further or provide resources on the matter? I am confused by the screenshots and how to configure the data to do this. Thank you again for your help!

 

BriceRM

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.