Forum Discussion

Navaneetharaju_'s avatar
2 years ago

Need Support in problem approaching(dax)

Hi All,

Anonymous, Anonymous 

I have to create a run book report.

This data contains task details, this task helps to trigger the certain operations based on the schedules it triggers the operation.

 

As per the data i provided, I want to find how many tasks are running based on schdules.

 

Scenarion 1:

TASK A  Started running from

Start_date 23-Mar-2019 , start time 00:00:00 , cron month *(star) means it will run all 12 months, if *(star) presents in the field values that means it will run all the month, cron_day - * means it will run all the days based on a month, Cron_day_of_week  - *(Star) means it will run all the days in the week(mon- sun), Cron hour - 23 means 23:00 this it will run, cron_minute - 00, so this Task A runs all the month and all the days in the month, alll the days in the weeks and runs only 23:00 that time on a day.

 

If i filter the data using data slicer for example I select date range 24-Mar-2019 to 26-Mar-2019 these 3 days Tasks A run 3 times at 23:00. so between these days task A count is 3

 

Scenario 2:

TASK B Started running from 26-10-2017 that day onwards start time is 02:03 , cron_month - * it will all the months in the calender, Cron_day - 1, 10, 11, 12, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31 on these days it should run. Cron_day_of_week - * means it will run all the days in the week except the day that not mentioned in Cron_day, Cron_hour-  02, Cron_minute - 03 , so TASK B  run all the month (Jan-Dec) from the start_date onwards and it will run only those days mentioned in Cron_Days at 02:03.

In my Date slicer if i select a range from 25-10-2017 to 31-10-2017 , Task B running count is 6 but i have selected 7 days, the reason is 25-10-2017 the task is not alive, so these 7 days, Task B count 6.

 

Scenario 3;

TASK H - Started running from 20-06-2016 from that day onwards start time is 07:01:47. Cron_month - * means it will run all the the month(jan-dec) , Cron_day - * means it will run all the days(jan-dec) , Cron_day_of_week - * means all the days (mon-sun) , Cron hour is * means will run all the hours from 00(hh) - 23(hh) ,  Cron minute - 05, 20, 35, 50  which means 00:05, 00:20, 00:25, 00:50 , On a single day, between 00:00 - 01:00 it runs 4 times.

Slicer - If i select date range in slicer 20-06-2016 to 20-06-2016 , only one day i have selected and TASK H in Task_name slicer , what count we should receive is 
68, I have enclosed the small excel visual for TASK H

 

Scenario 4 :

TASK I - started from 13-08-2019 start time is 16:00 from cron_Month - 1,3,5,7,9,11(Jan, Mar, May, Jul, Sep, Nov) in this month only it should run, cron_day -1st mon which means above six month (01-Jan, 01-Mar, 01-May, 01-Jul, 01-Sep, 01-Nov) only these days alone it should run , cron_hour -09, Cron minute - 00, so this task i will run only the cron_months and cron_day on 09:00 time.

 

Slicer 1 : if i select Task_name - I and
slicer 2 - date range between 13-08-2019 to 01-11-2020 , at 09:00 in our bar chart or table the count is 8 (because in 2019 -  Sep and Nov then 2020 those 6 months one time)

 

the same way i have to find in which server we were running more count. which category we were running more task counts

 

I have attached the same data which helps to create a report with slicers

 

task_namestart_datestart_timetime_zonerepeat_bycron_monthcron_daycron_day_of_weekcron_hourcron_minuteend_occuranceend_whentask_stateServerCategory
Task A2019-03-2300:00:00US/Easterncron***230nullneverDisabledProd_AMCM
Task B2017-10-2602:03:00UTCcron*1,10,11,12,13,14,15,16,25,26,27,28,29,30,31*23nullneverEnabledProd_EURDI
Task C2017-03-3112:30:00US/Easterncron1,2,3,4,5,6,7,8,9,10,11,12  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31mon,tue,wed,thu,fri*0nullneverDisabledProd_AMCM
TASK D2016-02-2312:30:27US/Easterncron1,2,3,4,5,6,7,8,9,10,11,121,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31   mon,tue,wed,thu,fri  *,12,190nullneverDisabledProd_EUCM
TASK E2022-12-1422:45:00Asia/Kolkatacron*1,16,17,18,19,20*90nullneverEnabledProd_EUCM
TASK F2019-09-1021:00:00Asia/Kolkatacron*10*210nullneverDisabledProd_EUCM
TASK G2019-05-1315:30:55CETcron**mon,tue,wed730nullneverEnabledProd_AMRDI
TASK H2016-06-2007:01:47US/Easterncron****5,20,35,50nullneverEnabledProd_AMIT
TASK I2019-08-1316:00:55US/Centralcron1,3,5,7,9,111st mon*90nullneverEnabledProd_AMCM
TASK J2020-04-2920:00:00Asia/Kolkatacron***0,4,8,12,16,20  04neverEnabledProd_AMOPS
Task K2023-06-2808:28:48US/Pacificcron***20,220,10,20,30,40,50  nullneverEnabledProd_AM_SLCloudPlexCM

 

 

2 Replies

  • Navaneetharaju_ , Based on what I got so far, and based on the assumption that you have dates and time tables. Try if these measures can help

     

    Task A Count =
    COUNTROWS(
    FILTER(
    'Table',
    'Table'[Task_name] = "Task A" &&
    'Table'[start_date] <= MAX('Date'[Date]) &&
    'Table'[start_date] + TIMEVALUE('Table'[start_time]) <= MAX('Date'[Date] + 'TimeTable'[Time]) &&
    'Table'[cron_month] = "*" &&
    'Table'[cron_day] = "*" &&
    'Table'[cron_day_of_week] = "*" &&
    'Table'[cron_hour] = 23 &&
    'Table'[cron_minute] = 0
    )
    )


    Task B Count =
    COUNTROWS(
    FILTER(
    'Table',
    'Table'[Task_name] = "Task B" &&
    'Table'[start_date] <= MAX('Date'[Date]) &&
    'Table'[start_date] + TIMEVALUE('Table'[start_time]) <= MAX('Date'[Date] + 'TimeTable'[Time]) &&
    CONTAINSSTRING('Table'[cron_day], DAY(MAX('Date'[Date]))) &&
    'Table'[cron_day_of_week] = "*" &&
    'Table'[cron_hour] = 2 &&
    'Table'[cron_minute] = 3
    )
    )

    • Navaneetharaju_'s avatar
      Navaneetharaju_
      Icon for Helper II rankHelper II

      Hi amitchandak , 

       

      I got your point, but measure should be dynamic based on a filter selection(Task name). the point is not mentioning task name in the measure.

      The point is we have to create the (Generate Series) series of virtual data(table) and assuming in these data, these may run based on filter condition we provide. when i select one futuredate based on repeat_every field, i have to present on this date , on this day and time these many tasks will run on that server. that's my requirement.