Forum Discussion

Viswa11's avatar
Viswa11
Frequent Visitor
2 years ago

Need Help in finding Dependent table data

Hi All,

 

I have below columns in my dataset.

table_name - T1,T2,T3..,
tenant_name - A, B, C.. Unique values,
Operation - Read, Write, Other

Wave - Wave1, Wave2, Wave3, Wave4


I want to find dependent tenants for suppose, My data is like below:

 

WaveTenantTableOperation
Wave1   ATab1READ
Wave2   BTab2WRITE
Wave3   CTab3OTHER
Wave4   DTab2READ
Wave1   ETab1WRITE
Wave3   FTab8WRITE

Here, I want to find dependent tenants. For example Tenant A is reading the table in wave 1 but same table was writing by Tenant E in Wave1. I want to mark this Tenant A has dependent.
If table was reading and writing by one tenant, There is no other tenant using that table i want to mark it has Exclusive.
I am expecting out put like below:

TenantWave1Wave2Wave3Wave4
A1000
B0100
C    
D    
E    

Here, Tenant A was dependent on 1 other tenants in wave1, Tenant A was not dependent on anyother tenant in Wave2.

 

Any leads will be appriciated!
Thanks in advance.
 Greg_Deckler amitchandak Ritaf1983 lbendlin Ashish_Mathur #Need Help

2 Replies

  • Hello Viswa11,

     

    Can you please try the following:

    DependentCount = 
    SUMX(
        FILTER(
            'YourTable', 
            'YourTable'[DependencyStatus] = "Dependent"
        ), 
        1
    )
    
    • Viswa11's avatar
      Viswa11
      Frequent Visitor

      Hi Sahir_Maharaj ,
      How can i find dependency table, I don't have any dependency column. For each individual operation I can do count and all but here I want to check is there any other tenant reading the table which was writting by other tenant then i want to mark has dependent table.
      I have tried something like below.

      Dependent =
      IF (
          'Table'[Operation] = "WRITE",
          IF (
              CALCULATE (
                  COUNTROWS ('Table'),
                  FILTER (
                      'Table',
                      'Table'[Operation]  = "READ"
                      && 'Table'[TENANT_NAME] <> EARLIER ('Table'[TENANT_NAME])
                      && 'Table'[TABLE_NAME] = EARLIER ('Table'[TABLE_NAME])


                  )
              ) > 0,
              "Dependent",
              "Not Dependent"
          ),
          "Not Applicable"
      )