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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
refint650
Helper III
Helper III

filtering within measure column

Hello 

 

How to write filter expression in measure column , below condition doesnt seem to work unless i use visual filter.

 

CALCULATE ( DISTINCTCOUNT( ID ), Filter( ID <> "" && Name  = "" ) )  or should i calculate table since filter whole table data.
 
KP.
 
 
1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @refint650 ,

 

You need to use the correct filter criteria. Reference is as follows:

M = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[ID] ),
    FILTER ( ALL ( 'Table' ), 'Table'[ID] <> BLANK () && 'Table'[Name] = BLANK () )
)

v-henryk-mstf_0-1620380766329.png


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @refint650 ,

 

You need to use the correct filter criteria. Reference is as follows:

M = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[ID] ),
    FILTER ( ALL ( 'Table' ), 'Table'[ID] <> BLANK () && 'Table'[Name] = BLANK () )
)

v-henryk-mstf_0-1620380766329.png


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

refint650
Helper III
Helper III

@ashish

not exactly 

 

distinctcount(ID),  where name <> "" and Flag ="" .

 

My suggested measure should work.  Share the link from where i can download your PBI file.  Show the incorrect answer and also let me know the exact result that you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Does this work?

=CALCULATE(DISTINCTCOUNTNONBLANK(Data[ID]),Data[Name]=BLANK())

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors