Forum Discussion
Line chart from Excel always shows flat line / bar for one table, summing up all values
- Anonymous3 years ago
Hi Anonymous ,
I test it in my Power BI Desktop, it works well.
Your visualization is correct, due to the fact that your Y-axis field is using data from two different tables, and there is no relationship between these two tables.
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It sounds like you're trying to create a stacked line chart in Power BI Online to compare download numbers for an app and the won/lost users over time, but you're encountering an issue where the second set of values is not being displayed as expected and is instead creating a flat line. This issue can occur due to the way the data is structured or how the chart is configured.
Here are some steps to troubleshoot and potentially resolve the issue:
Data Structure: Ensure that your data is properly structured. It should have two columns: one for the date (X-axis) and another for the values (Y-axis) you want to display. If you have two sets of values (downloads and won/lost users), you should have three columns in your data: Date, Downloads, and Won/Lost Users.
Data Type: Make sure that the date column is recognized as a date data type in Power BI. You can check this in the Power Query Editor or by selecting the date column in the Fields pane and setting its data type to Date.
Visualization Setup:
- Drag the Date column to the Axis field well to set it as the X-axis.
- Drag the Downloads and Won/Lost Users columns to the Values field well.
- In the Values field well, make sure the aggregation for both Downloads and Won/Lost Users is set to "Sum" or the appropriate aggregation method based on your data.
Legend and Stacking: Ensure that the Legend field well is empty, as you don't need to split the data by any category. The stacking should be set to "Stacked" for both Downloads and Won/Lost Users. You can set this in the "Format" pane under the "Data labels" section.
Check Data Quality: Verify that there are no missing or inconsistent values in your data. Sometimes, flat lines can be the result of missing data points.
Visual Interaction Filters: Make sure that there are no filters applied at the report level that could be affecting the chart's behavior.
Data Model: If you're importing data from multiple worksheets in Excel, ensure that the data from both worksheets is properly merged in the Power Query Editor and forms a single, coherent data table.
Chart Type: While you mentioned that a stacked area chart works, you might consider using a stacked column chart or clustered column chart to better represent the data if it's not displaying as expected with a stacked line chart.
If you've followed these steps and are still experiencing issues, it might be helpful to share a bit more detail about your data and the exact settings you're using in Power BI to better diagnose the problem. Additionally, consider checking for any updates or patches for Power BI Online, as software updates can sometimes resolve unexpected behavior.
Thank you for your detailed reply! I checked all the points, and it did give me some insights even if it did not resolve the issue - as the problem was that my data is in two tables and no connection in between exists.