Forum Discussion
Issue while plotting Line and bar chart
- 10 months ago
The Issue has been resolved
Hi Preethamsura ,
Thanks for reaching out to the Microsoft fabric community forum and for sharing the details and screenshots.
Your line measure is currently filtered on a specific bucket (for example, Bucket = 5). When you sort the X-axis by Bucket, Power BI applies category filters again, so the line measure only calculates for that bucket, which is why the line appears as a single point.
To keep the Bucket field sorted in ascending order and maintain the line:
Ensure the Bucket column is numeric and sorted by itself in ascending order. If you want to show a constant line (referencing Bucket 5 across all buckets), update the DAX to remove the Bucket filter.
Line_Value_Bucket5 =
CALCULATE(
SUM('Table'[Value]),
TREATAS({5}, 'Table'[Bucket]),
REMOVEFILTERS('Table'[Bucket])
)
This ensures the value from Bucket 5 appears as a line across all buckets even when the X-axis is sorted.
If you prefer the line to show exclusively for Bucket 5, the current measure is correct. It will only display a point on Bucket 5 once sorted.
If your goal is different, such as comparing buckets dynamically or working with a month hierarchy. Please provide a small sample dataset. This will help us redesign the setup and identify the accurate solution.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Want faster answers? How to Get Your Question Answered Quickly - Microsoft Fabric Community
Hope this helps. Please feel free to reach out for any further questions.
Thank you.