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

Best way to exclude a list of values from a column

Hello All,

 

I'm inquiring about the best way to exclude a list of values from a column when trying to count rows. These numeric values are unique. I am trying to count how many jobs are in my list, but certain ones do not meet the criteria and I wish to exclude them. I have a list of over 30 jobs ID, but I have reduced the amount here for the simplicity of this exercise. This list will likely be ongoing and will likely be additional jobs added in the future. What is the best way to write a measure to exclude them?

 

Example: I have a list of 16 jobs listed below and I want to exclude 57329, 70252, and 40506. Now my total should be 13 jobs. What is the best way to achieve this?

 

CategoryJob Number

A44313
A17168
A73348
A57329
A42925
A00548
A40506
A49690
A52855
A66307
A70252
A96697
A70842
A00954
A96694
A99503
2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I assume the Job number Column is TEXT type.

Please try to write the measure like below, and also please check the attached pbix file.

 

Untitled.png

 

Total jobs count under condition: =
CALCULATE (
    COUNTROWS ( VALUES ( Data[Job number] ) ),
    NOT ( Data[Job number] IN { "57329", "70252", "40506" } )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

Hi,

Thank you for your message, and I am not sure how you want to show it.

Please check the attached file if it works for you.

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

I assume the Job number Column is TEXT type.

Please try to write the measure like below, and also please check the attached pbix file.

 

Untitled.png

 

Total jobs count under condition: =
CALCULATE (
    COUNTROWS ( VALUES ( Data[Job number] ) ),
    NOT ( Data[Job number] IN { "57329", "70252", "40506" } )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you, it works. Question, how can i list the results in a matrix table format? Is it possible?

Hi,

Thank you for your message, and I am not sure how you want to show it.

Please check the attached file if it works for you.

Thank you.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you, that's exactly what i wanted. Much appreciated. 

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.