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,
I tried to implement a solution based on your original post. Please check the below pbix file.
creating a filter based on columns.pbix
If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too. And if you found it useful, a quick "Kudos" is always appreciated, thanks!
Best Regards,
Maruthi