This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
I'm trying to make a bar chart that uses measures as values, and I want to encode measures with different variables (1 or 0) that I can multiply the values by so that I can use a slicer to toggle whether or not they appear on the chart. How would I do that effectively, or is there a better way?
Solved! Go to Solution.
Hi @Anonymous ,
Thanks for reaching out to the Microsoft fabric community forum.
Create a bar chart that shows multiple measures, but only the selected ones based on a slicer.
In Power BI, New Table, and create a static list of the measures:
MeasureSelector =
DATATABLE(
"MeasureName", STRING,
{
{"Sales"},
{"Profit"},
{"Cost"}
}
)
This table is not related to your data model.
Use the MeasureName column from the MeasureSelector table as a slicer (set to multi-select).
Format the slicer as a vertical list or dropdown.
If you want the axis to show measure names, create this table:
ChartAxis =
DATATABLE(
"MeasureName", STRING,
{
{"Sales"},
{"Profit"},
{"Cost"}
}
)
Use ChartAxis [MeasureName] as the Axis in your bar chart.
Show Measure Value =
VAR SelectedMeasure = SELECTEDVALUE(ChartAxis[MeasureName])
VAR IsSelected =
CALCULATE(
COUNTROWS(MeasureSelector),
MeasureSelector[MeasureName] = SelectedMeasure
)
RETURN
SWITCH(
TRUE(),
SelectedMeasure = "Sales" && IsSelected, [Sales Measure],
SelectedMeasure = "Profit" && IsSelected, [Profit Measure],
SelectedMeasure = "Cost" && IsSelected, [Cost Measure],
BLANK()
)
Replace [Sales Measure], [Profit Measure], and [Cost Measure] with your actual measures.
Axis: ChartAxis [MeasureName]
Values: Show Measure Value
Slicer: MeasureSelector [MeasureName]
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team
Hi @Anonymous ,
Thanks for reaching out to the Microsoft fabric community forum.
Create a bar chart that shows multiple measures, but only the selected ones based on a slicer.
In Power BI, New Table, and create a static list of the measures:
MeasureSelector =
DATATABLE(
"MeasureName", STRING,
{
{"Sales"},
{"Profit"},
{"Cost"}
}
)
This table is not related to your data model.
Use the MeasureName column from the MeasureSelector table as a slicer (set to multi-select).
Format the slicer as a vertical list or dropdown.
If you want the axis to show measure names, create this table:
ChartAxis =
DATATABLE(
"MeasureName", STRING,
{
{"Sales"},
{"Profit"},
{"Cost"}
}
)
Use ChartAxis [MeasureName] as the Axis in your bar chart.
Show Measure Value =
VAR SelectedMeasure = SELECTEDVALUE(ChartAxis[MeasureName])
VAR IsSelected =
CALCULATE(
COUNTROWS(MeasureSelector),
MeasureSelector[MeasureName] = SelectedMeasure
)
RETURN
SWITCH(
TRUE(),
SelectedMeasure = "Sales" && IsSelected, [Sales Measure],
SelectedMeasure = "Profit" && IsSelected, [Profit Measure],
SelectedMeasure = "Cost" && IsSelected, [Cost Measure],
BLANK()
)
Replace [Sales Measure], [Profit Measure], and [Cost Measure] with your actual measures.
Axis: ChartAxis [MeasureName]
Values: Show Measure Value
Slicer: MeasureSelector [MeasureName]
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it
Best Regards,
Sreeteja.
Community Support Team
Hi @Anonymous ,
Just wanted to check if you had the opportunity to review the suggestion provided?
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
If you have the ability to do so (non-direct query data model) you should be able to create a field parameter with your measures so you can dynamically choose which ones to include in your visual. Here's the link to the Microsoft document for field parameters: Use report readers to change visuals (preview) - Power BI | Microsoft Learn
Check out the April 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 |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 22 | |
| 22 |