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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to make calculated column based on filtered table

Hi,

 

I'm new to Power BI and have a single excel spreadhseet.
I have the code for a filter which I used in a measure to get the number of expected rows and its comes through correctly.

The filtered code is in the format "FILTER(Database,Expression)"

I want to be able to make a calculated column for my data table where every row that is present in the Filtered datatable is shown as 1, else 0.

 

Th current code I used is:

IF(CONTAINS(FILTER(Database,Expression),random_column_name,random_column_name),1, 0)
 
However, that is making every row in the table as 1 instead of just the filtered datatable I expect. Any help is greatly appreciated. Thanks!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , if you want to display data to reduce, you need to create a measure and use that in the table visual along with other columns

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , if you want to display data to reduce, you need to create a measure and use that in the table visual along with other columns

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

Thanks for replying, that solved my issue! To anyone else who does not want to show the measure (where measure is the Filter formula) next to the column table in the visual, you can also filter the data table based on the created measure and say 'if measure is equal to 1' and lock the filter.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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