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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

restrict data in a column based on conditions

Hi,

 

How can i restrict to view only Employee Data, which does not have Null or 0.

In the below example i would need is only EMP ID  2 & 4 which does not have Null or 0

EMP ID     Material     Product id
1               A                Null
1               B                123
1               C                345

2               A               123
2               B                345

3               A               0
3               B               345

4               A              123
4               B              345
4               C              567
4               D             789

 

Regards,

San

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

I suppose the Product id column is text type, you can create a calculate column using dax below:

Flag = CALCULATE(COUNTROWS('Table'), FILTER(ALLEXCEPT('Table', 'Table'[EMP]), 'Table'[Product id] <> "Null" && 'Table'[Product id] <> "0")) = CALCULATE(COUNTROWS('Table'), ALLEXCEPT('Table', 'Table'[EMP]))

1.PNG 

Then create a calculate tabel using dax below to achieve the filtered table.

Filtered Table = SUMMARIZE(FILTER('Table', 'Table'[Flag] = TRUE()), 'Table'[EMP], 'Table'[Material], 'Table'[Product id])

2.PNG 

 

Community Support Team _ Jimmy Tao

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

1 REPLY 1
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

I suppose the Product id column is text type, you can create a calculate column using dax below:

Flag = CALCULATE(COUNTROWS('Table'), FILTER(ALLEXCEPT('Table', 'Table'[EMP]), 'Table'[Product id] <> "Null" && 'Table'[Product id] <> "0")) = CALCULATE(COUNTROWS('Table'), ALLEXCEPT('Table', 'Table'[EMP]))

1.PNG 

Then create a calculate tabel using dax below to achieve the filtered table.

Filtered Table = SUMMARIZE(FILTER('Table', 'Table'[Flag] = TRUE()), 'Table'[EMP], 'Table'[Material], 'Table'[Product id])

2.PNG 

 

Community Support Team _ Jimmy Tao

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

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.