Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jcastr02
Post Prodigy
Post Prodigy

Filtering based on two calculated columns using OR

I have two calculated columns with results either showing "yes" or "no" based on due dates.  How can I filter to show results that are Yes for column A   OR       Yes for Column B

 

Column A         Column B 

Yes                    No

No                    No

Yes                   No

Yes                   Yes

Yes                   Yes

8 REPLIES 8
Anand24
Super User
Super User

Hi @jcastr02 ,

 

You can simply create a measure with your conditions and then use it in filter.

Create new measure using below DAX:

Filter Measure = IF(MAX('Table'[ColumnA]) = "Yes" || MAX('Table'[ColumnB]) = "Yes",1,0)

 

Reference Image:

filter measure.PNG

 

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

Hello Anand, thanks for the help  @Anand24     See below.  I am seeing all of them are being included.... the one in red should not be included because they are both "no"         Looking for if either column is a Yes, then it should be included.  I appreciate any guidance.  filtering.png

@jcastr02 ,

 

The DAX and method I mentioned in my first comment will give you result from the Report view.

From your screenshot, you seem to be present at the Data View. You will need to create a calculated column to filter out.

 

Step 1: Create Calculted Column using below DAX:

Filter Column = IF('Table'[ColumnA] = "Yes" || 'Table'[ColumnB] = "Yes","Keep","Remove")

 

Step 2: Filter new column with only "Keep"

 

Reference Image:

filter col.PNG

 

PBI_SuperUser_Rank@1x.png  

Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

Proud To Be a Super User !!!
LinkedIn

mahoneypat
Microsoft Employee
Microsoft Employee

In the query editor, add a new custom column with a formula like this and then filter on it.

 

= if [Column A] = "Yes" or [Column B] = "Yes" then "Keep" else "Remove"

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


@mahoneypat   Thank you for help.   Since they are two calculated columns, they don't come up under the "available columns" for me to select from.  any guidance would be appreciated. 

amitchandak
Super User
Super User

@jcastr02 , Try a measure like

calculate(countrows(Table), filter(Table, table[Column A] = "Yes" || table[Column B] = "Yes"))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hello @amitchandak   I tried that but all the values are coming up the same.  Looking for it to show "include" if Either column "Accept SLA late?"="yes"    OR "Fix SLA late?"="yes"   if not , Exclude...

late.png

 

 

@jcastr02 , I suggested a measure.

For a column 

if(table[Column A] = "Yes" || table[Column B] = "Yes" , "Include", "Exclude") // One is yes

 

or

 

if(table[Column A] = "Yes" && table[Column B] = "Yes" , "Include", "Exclude") // Both should be yes

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.