Forum Discussion

andrewb95's avatar
andrewb95
Helper II
5 years ago
Solved

DateDiff with blanks

I have a table with data similar to below:

 

IDDate ADate BDate Diff
102.06.2021  
2 09.07.2021 
301.01.202105.01.20214
407.02.202101.02.2021-6

 

As you can see there are four possible outcomes... 

1. Date A happens first and there is no Date B for this row

2. Date B happens first and there is no Date A for this row 

3. Date A happens first but the action has been taken in Date B too 

4. Date B happens first but the action has been taken in Date A too 

 

I want to be able to make a table which shows the count for each four items 1-4. So I can identify which is the most popular flow. 

Then also for 1 and 2 I will be able to manipulate the date diff. 

 

Please advise?

 

  • andrewb95 

    is this what you want?

    1 = countx(FILTER('Table',ISBLANK('Table'[Date B])),'Table'[Date A])
    
    2 = countx(FILTER('Table',ISBLANK('Table'[Date A])),'Table'[Date B])
    
    3 = countx(FILTER('Table','Table'[Date A]<'Table'[Date B]),'Table'[Date A])
    
    4 = countx(FILTER('Table','Table'[Date A]>'Table'[Date B]&&NOT(ISBLANK('Table'[Date B]))),'Table'[Date A])

3 Replies

  • andrewb95 

    is this what you want?

    1 = countx(FILTER('Table',ISBLANK('Table'[Date B])),'Table'[Date A])
    
    2 = countx(FILTER('Table',ISBLANK('Table'[Date A])),'Table'[Date B])
    
    3 = countx(FILTER('Table','Table'[Date A]<'Table'[Date B]),'Table'[Date A])
    
    4 = countx(FILTER('Table','Table'[Date A]>'Table'[Date B]&&NOT(ISBLANK('Table'[Date B]))),'Table'[Date A])
  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi andrewb95 ,

     

    According to your description, I did a test and think that the solution provided by ryan_mayu  can meet your needs. If there is still confusion, please point out and provide the desired result, I will answer you as soon as possible.

     

     

     Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.