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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sarath5140
Helper I
Helper I

Detect ID's in the table which doesn't have specific Category in Power BI

Hi Folks,

 

Need your help in solving the below issue. I have the below table

 

IdExternalIdCategory
1717Implement
1346Test
2589Implement
2646Other
2758Test
3891Other
41078Implement
4967Other
4999Data

 

Ideally, my output should have for each ID, there should be atleast one Category values as "Test". Now, i want my output should show only ID's which don't have atleast 1 Catgeory as "Test"

 

Output :-

 

IdexternalIdCategory
3891Other
41078Implement
4967Other
4999Data

 

Thanks

1 ACCEPTED SOLUTION
DoubleJ
Solution Supplier
Solution Supplier

Hi

A calculated column with this formula should do what you need:

 

HasTestCategory = 
VAR ThisId = 'Table'[Id]

RETURN
IF(
    COUNTROWS(
        FILTER(
            'Table',
            'Table'[Category] = "Test" && 'Table'[Id] = ThisId))
    >0,
    TRUE(),
    FALSE() )

It might not be very performant if you have a large table. In your visual you can simple filter all the items with HasTestCategory = FALSE.

testcategory.png

Hope this helps (if so give me kudo ;-))
JJ

View solution in original post

1 REPLY 1
DoubleJ
Solution Supplier
Solution Supplier

Hi

A calculated column with this formula should do what you need:

 

HasTestCategory = 
VAR ThisId = 'Table'[Id]

RETURN
IF(
    COUNTROWS(
        FILTER(
            'Table',
            'Table'[Category] = "Test" && 'Table'[Id] = ThisId))
    >0,
    TRUE(),
    FALSE() )

It might not be very performant if you have a large table. In your visual you can simple filter all the items with HasTestCategory = FALSE.

testcategory.png

Hope this helps (if so give me kudo ;-))
JJ

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.