Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Remove weekends from ideal trend

How would I remove the weekends from this measure so that Sat and Sun are not included? Optionally, is it possible to have a way to add holidays ad hoc ?

Ideal Trend = var _date =SELECTEDVALUE('SprintDays'[Date])
var _first_wed  =MAXX(
    FILTER(
        ALLSELECTED('SprintDays'),
        'SprintDays'[Date] <= _date &&
        'SprintDays'[Flag] <> BLANK() &&
        WEEKDAY('SprintDays'[Date], 2) = 3   // 3 = Wednesday
    ),
    [Date]
)
var _first_wed_value = CALCULATE( SUM('Burndown'[StoryPoints]) , 'SprintDays'[Date] =_first_wed)
VAR _minus = IF(
    DATEDIFF(_first_wed, _date, DAY) >= 7,
    DATEDIFF(_first_wed, _date, DAY) - 0,
    DATEDIFF(_first_wed, _date, DAY)
)
VAR _weekday = WEEKDAY(_date, 2)

return
IF(_weekday in {6,7},BLANK(),_first_wed_value - DIVIDE(_first_wed_value,13) * _minus)
  • Hi Anonymous ,

     

    It seems that Your measure has already excluded the weekend

    Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

    Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

     

    Refer to:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,

    Jianbo Li

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

1 Reply

  • Hi Anonymous ,

     

    It seems that Your measure has already excluded the weekend

    Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?

    Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

     

    Refer to:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

    Best Regards,

    Jianbo Li

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