Forum Discussion

AndrewPF's avatar
AndrewPF
Helper V
2 years ago

missing data but with additional information from both tables

If I have a list of standard controls as follows: 

 

Control Set

HR Security

Compliance

Web Security 

Incident Response 

 

and a separate list of businesses, along with their own controls:  

 

Company           Control Set

Fever Tree          HR Security 

Fever Tree          Compliance 

Fever Tree          Incident Response

Britvic                 HR Security

Britvic                 Compliance

Britvic                 Web Security

Thwaites             HR Security

Thwaites             Compliance 

Thwaites             Web Security

Thwaites             Incident Response 

PepsiCo              HR Security 

PepsiCo              Web Security 

PepsiCo              Incident Response 

 

then I need a way of identifiying which business have missing controls, and which controls are missing from each business, i.e.: 

 

Company       Control Set 

Fever Tree       Web Security 

Britvic              Incident Response 

PepsiCo           Compliance

 

Any ideas please? 

8 Replies

  • Hi,

    These measures work

    Controls present = CONCATENATEX(VALUES(Company[Control Set]),Company[Control Set],",")
    Controls absent = CONCATENATEX(EXCEPT(Control,VALUES(Company[Control Set])),Control[Control Set],",")

     

  • I tried using the "Controls present" formula but I get the error message "A single value for column [column name] in table [table name] cannot be determined.  This can happen when a measure formula refers to a column that contains many values...". 

    I probably should have specified that there are other columns in both tables.  Does that matter? 

    • lbendlin's avatar
      lbendlin
      Super User

      Please provide sample data that fully covers your issue.
      Please show the expected outcome based on the sample data you provided.

  • First table name: "Control Sets": 

     

    Business UnitName
    Fever TreeHR Security 
    Fever TreeCompliance 
    Fever TreeIncident Response
    BritvicHR Security
    BritvicCompliance
    BritvicWeb Security
    ThwaitesHR Security
    ThwaitesCompliance 
    ThwaitesWeb Security
    ThwaitesIncident Response 
    PepsiCoHR Security 
    PepsiCoWeb Security 
    PepsiCoIncident Response 

     

    Second table name: "Control Set Fact Table": 

     

    Control Set IndexControl Set Name
    1HR Security
    2Compliance 
    3Web Security
    4

    Incident Response 

     

    Desired outcome - missing data: 

     

    Business UnitControl Set 
    Fever TreeWeb Security 
    BritvicIncident Response 
    PepsiCoCompliance

     

    • lbendlin's avatar
      lbendlin
      Super User

      Your "control set fact table"  likely isn't a fact table, it seems to be a reference/dimension table.

       

      Consider using a data model

       

       

      and a graphical solution to the question.

       

      What should happen if a business unit misses more than one control set?

  • Unfortunately, I have 33 control sets and 200 business units, so a matrix or table just won't work graphically. 

    The requirements from my customer are very specific i.e. a list of all missing control sets from each business unit which is missing at least one control set. 

    • lbendlin's avatar
      lbendlin
      Super User

       

      Missing = CONCATENATEX(EXCEPT(SELECTCOLUMNS('Control Set Reference',"Name",[Control Set Name]),VALUES('Control Sets'[Name])),[Name],",")

       

      see attached