Forum Discussion
Slicer that Covers Multiple Columns
I have a table called 'WO Raw Data' that contains rows of machine breakdown data. Each row contains up to four faults, spread over 4 columns.
I am trying to add a slicer to bar chart where the user can select a fault from the list and the chart will count only rows of breakdowns where that fault appears in any of the four columns.
I can't unpivot my data as it impacts other measures and is a very large data set. So I created a new table, as follows:
CMoppet , You need to create a measure that will count the rows where the selected fault appears in any of the four columns.
FaultCount =
CALCULATE(
COUNTROWS('WO Raw Data'),
FILTER(
'WO Raw Data',
'WO Raw Data'[Fault Analysis Task2 Level2.2] IN VALUES(AllFaults[Fault]) ||
'WO Raw Data'[First Fault Level 2.2] IN VALUES(AllFaults[Fault]) ||
'WO Raw Data'[Fault Analysis Task3 Level2.2] IN VALUES(AllFaults[Fault]) ||
'WO Raw Data'[Fault Analysis Task4 Level2.2] IN VALUES(AllFaults[Fault])
)
)Add your bar chart visualization.
Use the FaultCount measure as the value for the bar chart.
Add the AllFaults[Fault] column to the slicer.
2 Replies
- bhanu_gautamSuper User
CMoppet , You need to create a measure that will count the rows where the selected fault appears in any of the four columns.
FaultCount =
CALCULATE(
COUNTROWS('WO Raw Data'),
FILTER(
'WO Raw Data',
'WO Raw Data'[Fault Analysis Task2 Level2.2] IN VALUES(AllFaults[Fault]) ||
'WO Raw Data'[First Fault Level 2.2] IN VALUES(AllFaults[Fault]) ||
'WO Raw Data'[Fault Analysis Task3 Level2.2] IN VALUES(AllFaults[Fault]) ||
'WO Raw Data'[Fault Analysis Task4 Level2.2] IN VALUES(AllFaults[Fault])
)
)Add your bar chart visualization.
Use the FaultCount measure as the value for the bar chart.
Add the AllFaults[Fault] column to the slicer.- CMoppetHelper IV
Thank you! This worked perfectly 🙂