Forum Discussion

andris_'s avatar
andris_
Resolver I
9 years ago
Solved

date/holiday issue

Hey everyone,   I'm quite new to the Power BI, I've just started working with it since January. We are trying to automate some processes, and there's a problem with it when it comes to the personal...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi andris_,

     

    You can try to use belwo formulas:

    1. Add a calculated column to holiday table to convert the holiday date range to text.

     

    HolidayRange = CONCATENATEX(CALENDAR([From],[Till]),[Date],",")

     

    2. Add a measure to working table to calculate if the order is posting in the holiday range.

     

    IsPostInHoliday = 
    var currDate=MAX(Working[Date])
    Var currUser= LASTNONBLANK(Working[Technican name],[Technican name])
    var totalHoliday= CONCATENATEX(FILTER(ALLSELECTED(Holiday),[Claimant]=currUser),[HolidayRange],",") //summary all date range
    return
    ISERROR(Search(currDate,totalHoliday))=FALSE()

     

    Regards,

    Xiaoxin Sheng