Forum Discussion
Power BI Visual, two field filter but using OR
Greetings, thank you for looking
I have a visual that displays activities and there is a field called "Error" which is a yes/no field and then a separate field called "Error Message" which is a text field.
The report and data tables are all built and deployed...this particular visual was setup to filter based upon Error being Yes
It has been recognized that we have records where the Error field has No selected...but there is an Error Message. We also have records where the Error is Yes but the Error Message is null.
What I need to do for this visual is filter on Error being yes OR Error Message not being null.
I am having a brain cramp of a way to filter the visual as is to accomplish what I am looking to do.
Had I known this situation in development I could have created a column with an "if then" to create a flag...I am trying to avoid to have to create the field now after the report has been produced...reason for my hesitation is that I am using a shared semantic model that feeds 10 reports...it wouldn't be the end of the world to add a new field...but I would like t avoid making changes to data tables...
Any insight would be greatly appreciated.
Use a Visual-level-filter with a measure
If you want the filter logic cleanly and reuse it, you can create a measure like this:
ShowRecordFlag = IF( [Error] = TRUE() || NOT(ISBLANK([Error Message])), //Try with && if || is not working 1, 0 )Then use Visual-level filter:
-
Drag ShowRecordFlag into the visual’s filters pane.
-
Set the filter to "is 1".
-
4 Replies
- mh2587Super User
Use a Visual-level-filter with a measure
If you want the filter logic cleanly and reuse it, you can create a measure like this:
ShowRecordFlag = IF( [Error] = TRUE() || NOT(ISBLANK([Error Message])), //Try with && if || is not working 1, 0 )Then use Visual-level filter:
-
Drag ShowRecordFlag into the visual’s filters pane.
-
Set the filter to "is 1".
-
- v-venuppuCommunity Support
Hi Gusd8 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
- v-venuppuCommunity Support
Hi Gusd8 ,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please accept it as a solution and give it a 'Kudos' so other community members with similar problems can find a solution faster.
Thank you.