Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

date % calculations

Hi,

 

My data is below and need to calcualte % calculations based on dates and region.

I need to calculate Date1 % and Date2 %.

 

Based on region,

if date1 filled with all dates, then date1 % should be 100%.

If one date is filled then date1% should be 33.33%. 

If two dates are filled, then date1% should be 66.67

 

RegionDate1Date1 %Date2Date2 %
A7/15/20211008/1/202133.33
A7/14/2021100 0
A7/21/2021100 0
B8/1/202166.678/12/2021100
B8/4/202166.678/14/2021100
B 08/20/2021100
C8/7/20211008/1/202166.67
C8/7/20211007/12/202166.67
C8/9/2021100 0
  • Try Below

    Set this measure format as the percentage

    Create  similar for other date as well

     

    Date 1 % = 
    Var d = CALCULATE(COUNT('Table'[Region]),ALLEXCEPT('Table','Table'[Region]))
    Var e =  CALCULATE(COUNTBLANK('Table'[Date1]),ALLEXCEPT('Table','Table'[Region]))
    RETURN
    (d-e)/d

     

2 Replies

  • FarhanAhmed's avatar
    FarhanAhmed
    Community Champion

    Try Below

    Set this measure format as the percentage

    Create  similar for other date as well

     

    Date 1 % = 
    Var d = CALCULATE(COUNT('Table'[Region]),ALLEXCEPT('Table','Table'[Region]))
    Var e =  CALCULATE(COUNTBLANK('Table'[Date1]),ALLEXCEPT('Table','Table'[Region]))
    RETURN
    (d-e)/d