Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Open OR Close date in one visualization

Hi all - 

 

I work at a Bank, we pull in our depositor data daily through a direct query. At any given time, we only have one 'production date' worth of data, which is a snapshot in time of our accounts. 

 

Our deposit data is a list of 300k+ accounts and the various attributes tied to these accounts (branch, region, product type, etc. etc.). Two of these attributes are Open Date, and Close Date. Below is an example of what the data would look like. 

 

Production DateAccount NbrBranchOpen DateClose Date
9/23/2019561465486319/2/2019 
9/23/2019673758583615/3/19827/1/2019
9/23/2019808510300319/7/2019 
9/23/2019970212360311/15/19999/10/2019
9/23/2019831610594613/30/2008 
9/23/20197128090811110/11/1992 
9/23/2019610979212327/11/1979 
9/23/2019523696467729/21/2019 
9/23/2019448882686628/14/20028/1/2019
9/23/20193847565885212/16/1987 
9/23/2019329791361625/23/1975 
9/23/2019282678309928/14/1964 

 

I'm trying to create a single table (or matrix) that shows the accounts opened and closed in the last 30 days by Branch. (The bolded items).

 

I can do them separately by setting a filter on Close Date or Open Date, respectively. But I am not sure how to put them together in one visual. I would need to show records where Close Date is in the last 30 days OR Open Date is in the last 30 days. 

 

Any help would be greatly appreciated!

 

 

  • Hi Anonymous 

    Create measures

    o = DATEDIFF(MAX('Table'[open Date]),TODAY(),DAY)
    
    c = DATEDIFF(MAX('Table'[Close Date]),TODAY(),DAY)
    
    Measure 3 = IF([o]<>BLANK()&&[o]<=30,1,IF([c]<>BLANK()&&[c]<=30,1,0))

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Join both Dates with the same date dimension.  One join will be enabled and another one will be disabled.

    Now in calculate use "userelation" to activate the relation you want 

     

  • Try

    = Calculate( sum (total deposits), OR( filter1, filter2 ) ) )


    If you don't wrap your filters in an OR it treats them as an AND.
  • Or try

    = CALCULATETABLE( VALUES(Accounts[ACCOUNT NBR]), OR( FILTER1, FILTER2) )
  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous 

    Create measures

    o = DATEDIFF(MAX('Table'[open Date]),TODAY(),DAY)
    
    c = DATEDIFF(MAX('Table'[Close Date]),TODAY(),DAY)
    
    Measure 3 = IF([o]<>BLANK()&&[o]<=30,1,IF([c]<>BLANK()&&[c]<=30,1,0))

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.