Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello there,
I have this line chart where the X axis is a date column and on the Y axis I have three different lines, each one representing one calculated column from my table. I want to be able to choose which ones appear on the chart, because they are very similar and the data labels don't help much being so close to each other.
Is there any way to dynamically select one, two, n lines to show in the line chart?
Thank you for your time and patience.
Solved! Go to Solution.
Hi, @Anonymous
This is my test data:
We need create a table to put the field in slice:
Here are the steps you can follow:
(1)We can create three measures:
Measure = IF("Column2" in SELECTCOLUMNS('Table 2',"1",'Table 2'[Value]),SUM('Table'[Column2]),BLANK())
Measure 2 = IF("Column3" in SELECTCOLUMNS('Table 2',"1",'Table 2'[Value]),SUM('Table'[Column3]),BLANK())
Measure 3 = IF("Column4" in SELECTCOLUMNS('Table 2',"1",'Table 2'[Value]),SUM('Table'[Column4]),BLANK())
(2)Then we can put the measures in the line chart and we can meet your need:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @Anonymous
According to your description , you want to show different Y-axis depending on the options. Right?
Here are the steps you can refer to :
(1)This is my test data:
(2)We can create a Table which includes the Y-axis fields in the visual:
(3)We can create a measure which will put in the Y-axis of the line chart:
Measure = IF( SELECTEDVALUE('Table 2'[Value]) ="Column2" , SUM('Table'[Column2]) , SUM('Table'[Column3]))
(4)Then we can put the field in the line chart and put the 'Table2'[value] in the slice and then we can meet your need:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you so much for your solution! I created a Switch clause because there were a lot of options. I can now see the chosen line in a chart.
Is there a way to re-formulate it in order to be able to select more than one value?
Thank you,
Hi, @Anonymous
This is my test data:
We need create a table to put the field in slice:
Here are the steps you can follow:
(1)We can create three measures:
Measure = IF("Column2" in SELECTCOLUMNS('Table 2',"1",'Table 2'[Value]),SUM('Table'[Column2]),BLANK())
Measure 2 = IF("Column3" in SELECTCOLUMNS('Table 2',"1",'Table 2'[Value]),SUM('Table'[Column3]),BLANK())
Measure 3 = IF("Column4" in SELECTCOLUMNS('Table 2',"1",'Table 2'[Value]),SUM('Table'[Column4]),BLANK())
(2)Then we can put the measures in the line chart and we can meet your need:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you very much, this was definitely what I was looking for!
It's so useful that I will save this post for future reports where I need something like it.
Again, thank you!
Yes, read about Field Parameters. They are ideal for such a scenario. Or - enable Personalize visuals and teach your users how to use that awesome feature.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |