Forum Discussion

Jadegirlify's avatar
Jadegirlify
Icon for Helper I rankHelper I
2 years ago
Solved

How can I Create A Table Showing Distinct Occurrence Of A Specific Column Values in PowerBI?

Employee_IDFULL_NAMEClearance_Type
101Amy LuSecret
102Joe BoyPolygraph
102Joe BoySecret
103Sam JackConfidential
103Sam JackConfidential
103Sam JackConfidential
104Tom SmithSecret
104Tom SmithConfidential
105Ann WilsonSecret
106Mark BrownSecret
106Mark BrownSecret
107Jane DoePolygraph
107Jane DoeSecret
107Jane DoePolygraph
108Tim BarkConfidential
108Tim BarkSecret
108Tim BarkPolygraph
109May AlecConfidential

 

I Need to create a table visual showing the result below.  I have tried multiple codes but none works. What query/measure should I be using?
Please note that employee_ID 103 & 106 were duplicated, but the clearance type is still only one type "Confidential".

 

Employee_IDFULL_NAMEClearance_Type
101Amy LuSecret
103Sam JackConfidential
105Ann WilsonSecret
106Mark BrownSecret
109May AlecConfidential
  • Jadegirlify 

    you can try to create a column

    Column = if(maxx(FILTER('Table','Table'[Employee_ID]=EARLIER('Table'[Employee_ID])&&('Table'[FULL_NAME]<>EARLIER('Table'[FULL_NAME])||'Table'[Clearance_Type]<>EARLIER('Table'[Clearance_Type]))),'Table'[FULL_NAME])="",1,0)
     
    then you add the column to visual filter and set to 1
     
     
    or create a measure
     
    Measure = if(maxx(FILTER(all('Table'),'Table'[Employee_ID]=max('Table'[Employee_ID])&&('Table'[Clearance_Type]<>max('Table'[Clearance_Type])||'Table'[FULL_NAME]<>max('Table'[FULL_NAME]))),'Table'[FULL_NAME])="",1,0)
     
    and add the measure to the visual filter and set to 1
     
     
     
    pls see the attachment below

6 Replies

  • Jadegirlify 

    you can try to create a column

    Column = if(maxx(FILTER('Table','Table'[Employee_ID]=EARLIER('Table'[Employee_ID])&&('Table'[FULL_NAME]<>EARLIER('Table'[FULL_NAME])||'Table'[Clearance_Type]<>EARLIER('Table'[Clearance_Type]))),'Table'[FULL_NAME])="",1,0)
     
    then you add the column to visual filter and set to 1
     
     
    or create a measure
     
    Measure = if(maxx(FILTER(all('Table'),'Table'[Employee_ID]=max('Table'[Employee_ID])&&('Table'[Clearance_Type]<>max('Table'[Clearance_Type])||'Table'[FULL_NAME]<>max('Table'[FULL_NAME]))),'Table'[FULL_NAME])="",1,0)
     
    and add the measure to the visual filter and set to 1
     
     
     
    pls see the attachment below
  • Hi,

    This measure works

    Measure = if(DISTINCTCOUNT(Data[Clearance_Type])=1,MIN(Data[Clearance_Type]),BLANK())