This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I have this line chart with values for different weeks. In the legend I've a department classification. I want to have slicer with Department values and I'd like the user to select a department and the chart only colors that department.
Line chart doesn't allow me to do conditional coloring. Does anyone have a work around? could we use Calculation Items in Tabular Editor?
Solved! Go to Solution.
Here is one way.
Create individual measures for each department. In my example they follow this pattern:
Classif A =
CALCULATE(SUM(fTable[Classification]), 'Department Table'[Department] ="A")
Next create a new Field parameter with all the individual measures:
Next duplicate the individual measures you created. In my example following this pattern (same measure; different name):
Points A = CALCULATE(SUM(fTable[Classification]), 'Department Table'[Department] ="A")
Next set up the line visual including the duplicate measures and the measure created by the field parameter (the order is important; the field parameter measure must be at the bottom of the bucket):
Now format the line colour so that only those included in the field parameter measure have a colour (I've made the colours different but you can use the same colour for these if you wish).
(I've also added selective labels for the FP parameter values)
And this is the result:
I've attached a sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
Here is one way.
Create individual measures for each department. In my example they follow this pattern:
Classif A =
CALCULATE(SUM(fTable[Classification]), 'Department Table'[Department] ="A")
Next create a new Field parameter with all the individual measures:
Next duplicate the individual measures you created. In my example following this pattern (same measure; different name):
Points A = CALCULATE(SUM(fTable[Classification]), 'Department Table'[Department] ="A")
Next set up the line visual including the duplicate measures and the measure created by the field parameter (the order is important; the field parameter measure must be at the bottom of the bucket):
Now format the line colour so that only those included in the field parameter measure have a colour (I've made the colours different but you can use the same colour for these if you wish).
(I've also added selective labels for the FP parameter values)
And this is the result:
I've attached a sample PBIX file
Proud to be a Super User!
Paul on Linkedin.
This worked perfectly for me. I just have to tweek it to control my filters but everything else worked as I wanted it. Thanks so much Paul for taking the time to respond to my question. appreciate it.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 29 | |
| 25 | |
| 25 | |
| 21 | |
| 14 |
| User | Count |
|---|---|
| 59 | |
| 50 | |
| 25 | |
| 20 | |
| 20 |