Forum Discussion

Malarvizhi_P_R's avatar
Malarvizhi_P_R
Regular Visitor
11 months ago
Solved

Need help in Planned % Calculation

Requirement - Need to calculate planned % Calculation ask - Need to consider Target start and Target end date columns for calculating date difference with day count. If 10 days is the difference ...
  • bhanu_gautam's avatar
    11 months ago

    Malarvizhi_P_R You can implement this logic in DAX by calculating the total planned duration (in days) and the elapsed duration (in days), then dividing the elapsed by the total to get the planned percentage.

     

    dax
    Planned % =
    VAR TodayDate = TODAY()
    VAR StartDate = [Target Start]
    VAR EndDate = [Target End]
    VAR TotalDays = DATEDIFF(StartDate, EndDate, DAY) + 1
    VAR ElapsedDays =
    IF(
    TodayDate < StartDate,
    0,
    IF(
    TodayDate > EndDate,
    TotalDays,
    DATEDIFF(StartDate, TodayDate, DAY) + 1
    )
    )
    RETURN
    DIVIDE(ElapsedDays, TotalDays, 0)

  • KarinSzilagyi's avatar
    KarinSzilagyi
    11 months ago

    Hi Malarvizhi_P_R could you share an example of your raw data? 
    I've tried to recreate a dataset based on what I can tell from your image, but my results don't look anywhere close to yours.

    This is how I assume your data might look like based on that image:

    And this is my result when I place it in a Matrix with the 0-100% Version of the Formula:

    Could you provide an Excel with data similar to your specific case?