Forum Discussion
Slicer filtering a table based on more than 1 column
- Anonymous3 years ago
Hi Shubham04 ,
According to your description, you want to use 'Table1'[Campaign] as the slicer and use the corresponding [Solution] field to filter the corresponding KPI table. Is that right?
You can refer to the following steps:
(1) My test data is the same as yours.
(2) We can create a measure:
Measure = var _slicer =VALUES('Table1'[Solution]) var _solution = MAX('Table3'[Solution]) return IF( _solution in _slicer ,1,0)(3) Then we help the measure to the corresponding visual "Filter on this visual", and then we can meet your needs.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ah ok,
then if it's only for one measure, you have to do it there:
YourMeasure =
VAR ValidSolutions =
VALUES(CampaignSolution[Solution])
RETURN
CALCULATE(
youMeasureCode,
FILTER(
KPITable,
KPITable[Solution] IN ValidSolutions
)
or if you want it for all of your measures I would suggest a calculation group with just one default item and the code:
Item =
VAR ValidSolutions =
VALUES(CampaignSolution[Solution])
RETURN
CALCULATE(
SELECTEDMEASURE(),
FILTER(
KPITable,
KPITable[Solution] IN ValidSolutions
)- lukiz843 years ago
Memorable Member
you could also replace the FILTER(...) part with:
TREATAS(VALUES(CampaignSolution[Solution]), KPITable[Solution])
I think that's faster.
- Shubham043 years ago
Microsoft Employee
Yes this works for measure, instead I'm using selectedvalue(Table1[Solution]) to get aggregated metrics, But this doesn't work in case of calculated column which im thinking could be used to filter out rows and view in the table visual as required-
Account Solution Contacts Leads Revenue
A1 S1 XXX XXX XXX
A2 S1 XXX XXX XXX