Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello everyone,
I'm currently working on a line chart visualization that plots 5 lines corresponding to different categories in my dataset.
In my demo (don't see any options to attach the power BI file), I have a filter, a column chart, and a line chart. The filter allows me to select all categories, which is crucial for the accuracy of the column chart's results. However, I'm encountering a dilemma with the line chart.
Ideally, I'd like to limit the number of lines displayed on the line chart, let's say to just 3, for better clarity and focus. My question is: what's the best approach to achieve this?
One option I'm considering is adding another filter specifically for the line chart, where users can select their desired number of categories. But I'm open to suggestions on how to implement this effectively.
Alternatively, I'm wondering if there's a way to automatically limit the number of lines on the chart. For instance, if the user selects more than 3 categories, the chart would randomly display any 3 of them. However, if the user specifically selects 1, 2, or 3 categories, only those corresponding lines would be shown. Something like this post.
Keep in mind that the filter I mentioned is connected with another chart, where selecting all categories is necessary. So any solution should consider this requirement.
Demo Data:
Year | Category | Number |
2022 | A | 20 |
2022 | B | 10 |
2022 | C | 22 |
2022 | D | 10 |
2022 | E | 25 |
2021 | A | 10 |
2021 | B | 22 |
2021 | C | 20 |
2021 | D | 15 |
2021 | E | 25 |
2020 | A | 15 |
2020 | B | 14 |
2020 | C | 28 |
2020 | D | 25 |
2020 | E | 26 |
I appreciate any insights or recommendations you might have on how to tackle this issue effectively. Thank you for your help!
Hi, @0Experience
I'm happy to answer your questions. There is no option to directly limit the number of rows on the chart in Power BI. If we want to limit the number of rows, we can limit the number of rows through measure. For example, if I want to display rows of three categories: A, B, and C, we can do this:
Dax formula:
Line = CALCULATE(SUM(Sheet1[Number]),'Sheet1',FILTER(VALUES('Sheet1'[Category]),'Sheet1'[Category] IN {"A","B","C"}))
Put this measure on the Y axis:
If the user selects more than 3 categories, the chart will randomly display any 3 of them. This feature is not currently available.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@AnonymousThank you for your response. I understand your concern. Currently, the measure is set up to display only data for A, B, and C. Even if you select multiple options, it will still only show data for A, B, and C.
Now, if a user wants to view data for B, D, and E, they won't be able to see D and E on the chart because the measure is configured to only display B.
can you not share the file with dropbox or another cloud provider and create the link in your post, that way it would be easier to understand what you are asking.
Proud to be a Super User!
User | Count |
---|---|
64 | |
59 | |
47 | |
33 | |
32 |
User | Count |
---|---|
84 | |
74 | |
54 | |
50 | |
44 |