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
refint650
Helper II
Helper II

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 II
Helper II

@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
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.