Forum Discussion
Issue while plotting Line and bar chart
I am working on a task to create a bar and line chart.
X-axis - Month , Bucket
Y-axis - Value
Line Y-axis : it is measure that I created [ Value 2 = Calculate(Sum(Value),Bucket=5)]
I want to sort my x-axis bucket in ascending order. How can I achieve it?
Problem: Upon sorting bucket my certificates count on y-axis line is going away.
I am using same column for buckets (I have 5 buckets , i am using total user bucket as y axis line) , puttting 4 buckets on x-axis.
Upon sorting I m getting y axis line value as dot.
@Superusers?
The Issue has been resolved
6 Replies
- MFelixSuper User
Hi Preethamsura ,
You refer you want to sort the chart by Bucket ascending order that is what you already have on the image, or do you want to have ascending by bucket and then by value inside each bucket?
Other question is regarding you refering that when you do the sorting you refer you get only a dot can you please give more context on this?
- AnonymousNot applicable
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 CommunityHope this helps. Please feel free to reach out for any further questions.
Thank you.
- AnonymousNot applicable
Hi Preethamsura ,
I wanted to check if you had the opportunity to review the information provided. If you still require support, please let us know, we are happy to assist you.
Thank you.
- AnonymousNot applicable
Hi Preethamsura ,
We haven’t received an update from you in some time. Could you please let us know if the issue has been resolved?
If you still require support, please let us know, we are happy to assist you.Thank you.
- PreethamsuraRegular Visitor
The Issue has been resolved
- AnonymousNot applicable