Forum Discussion
Hey team ! Need help creating a filter based on columns .
- 1 year ago
Hi Radz2707 ,
As you mentioned that, you data is confidential. you can't able to share sample data. Based on your inputs , i have created sample data.
Please follow below steps.
1. Created sample data based on your column headers. please refer snap.
2. Created disconnected table, to reprsent the flag names in slicer based on below DAX code.
FlagSelector = DATATABLE("FlagName", STRING,{{"IsCitizen"},{"HasPolicy"},{"HasPro"},{"HasPremium"},{"HasPPU"}})3. Created measure with below DAX code.FlagFilterMeasure =VAR SelectedFlag = SELECTEDVALUE(FlagSelector[FlagName])RETURNSWITCH(TRUE(),SelectedFlag = "IsCitizen", IF(MAX(SurveyData[IsCitizen]) = "Yes", 1, 0),SelectedFlag = "HasPolicy", IF(MAX(SurveyData[HasPolicy]) = "Yes", 1, 0),SelectedFlag = "HasPro", IF(MAX(SurveyData[HasPro]) = "Yes", 1, 0),SelectedFlag = "HasPremium", IF(MAX(SurveyData[HasPremium]) = "Yes", 1, 0),SelectedFlag = "HasPPU", IF(MAX(SurveyData[HasPPU]) = "Yes", 1, 0),1)4. In table visual, add Custono, SurveyWave columns. Add FlagSelector[FlagName] in slicer. and drag 'FlagFilterMeasure' measure in visual level filter and set the value ='1'.5. Please refer the output snap and attched PBIX file.If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi Radz2707
What does this mean?
P.S. I can't really unpivot the data as there are 15columns .
It would be easier for anyone to provide a more feasible solution had you provided a sample data which doesn't have to be confidential but actually represents the actual data, and your expected result from that. Ensure that we can easily copy-paste it.