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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Supercharlie50
Frequent Visitor

Count rows only if each item doesn´t have certain value in a column

Let me explain. We have a column full of serial numbers which appear multiples times in this column; they are repetitive.

Each serial number goes through different states along time. It appears each time it has a status. This status is stored in a column called "Status".

For example, one serial number (1234567FX) went through status 2, 19 , 53 and finally 9. This means there are 4 rows with this serial number with each status (123456FX with status 2, 123456FX with status 19, 123456FX with status 53 ,123456FX with status 9).

Attached is an image of the columns´ structure

.NTs Estados.png

 

What i need is to do a distinct count of serial numbers which HAVEN´T gone through state 53. For example, if a serial number had status 2, 43 and finally 8, it would be counted (distinctively), but if it had status 2, 43, 53 and ended with status 8, it wouldn´t be counted, in any of the status it went though, it would be dismissed entirely.

NT Estados 2.png

 

Is there any way to do this in Power BI?

Thanks in advance.

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

If you just need to see the serial numbers, create a table visual with the field, add the measure to the filter pane and set the value to 1.

If you need the distinctcount, include the measure in the table visual. (no need to use the filter pane).

You don't need the Status field





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

If you just need to see the serial numbers, create a table visual with the field, add the measure to the filter pane and set the value to 1.

If you need the distinctcount, include the measure in the table visual. (no need to use the filter pane).

You don't need the Status field





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you so much man, it worked! *Virtual hug* 🙂

PaulDBrown
Community Champion
Community Champion

Try:

Non 53 =
VAR _53 =
    CALCULATETABLE (
        VALUES ( Table[Serial Number] ),
        FILTER ( Table, Table[Status] = 53 )
    )
VAR _all =
    VALUES ( Table[Serial Number] )
RETURN
    COUNTROWS ( EXCEPT ( _all, _53 ) )




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






How could i display these serial numbers which meet these conditions, on a table? (just showing the columns serial number and status)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors