Forum Discussion

ab2022's avatar
ab2022
Frequent Visitor
3 years ago
Solved

Unique count on same table subgroup data

I am new to Power BI DAX coding. I’m trying to figure out how to create a measure to unique count 1. How many ProductID counts that have at least 1 comment 2. How many  ProductID counts that don't ...
  • Greg_Deckler's avatar
    3 years ago

    ab2022tamerj1 beat me to the punch but posting my very similar solution here since I took the time to create it. PBIX is attached below sig.

     

    YesNo = IF(COUNTROWS(FILTER('Table',[InspectorComments] <> BLANK())) + 0 > 0,"Yes","No")
    
    Unique ProductIDs with Comments = COUNTROWS(FILTER(SUMMARIZE('Table',[DeptID],[ProductID],"__YesNo",[YesNo]),[__YesNo] = "Yes")) + 0
    
    Unique ProductIDs without Comments = COUNTROWS(FILTER(SUMMARIZE('Table',[DeptID],[ProductID],"__YesNo",[YesNo]),[__YesNo] = "No")) + 0