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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

FILTER function does not work

Hello

 

I want to count the number of instances of the value in Col1 inside the Col1 after it is filtered based on a value for Col2.

 

I try to use this calculated column but it does not work:

Column = CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[Col1]=SELECTEDVALUE(Table1[Col1]) && Table1[Col2]="SOME"))

 

It returns the count of the value in Col1 in the whole table and not inside the table that is filtered by Table1[Col2]="SOME".

 

Any idea please?

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

You need a measure instead of a column,would you pls provide sample data with expected output for us to check the measure?

 

Much appreciated.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
 
edhans
Community Champion
Community Champion

Calculated Columns are not dynamic. They calculate only one time, when the data is loaded. Filtering, slicers, selecting data, crossfiltering, etc. all have no effect on calculated columns. They are not like columns in Excel that do recalc.

 

You need to redo this as a measure, and we'd need more info including sample data as to what you are trying to do to assist.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum

 

In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.