Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Create stacked bar chart with different categories based on time intervals

Hello everyone,   I have a data set that shows me the duration of a call, time the call ended, date of the call, day of the week of the call as pictured below:   My goal is to create a stac...
  • jdbuchanan71's avatar
    7 years ago

    Hello Anonymous ,

    Try adding this as a calculated column in your table. 

    Test =
    IF (
        WEEKDAY ( Table1[Call Date] ) IN { 1, 7 } ||
            NOT (
                Table1[Call End Time (MST)] > TIME ( 8, 0, 0 )
                    && Table1[Call End Time (MST)] < TIME ( 17, 0, 0 )
            ),
        "Out",
        "In"
    )
  • XLBob's avatar
    7 years ago

    I'd like to add all my custom columns inside Power Query if possible.

    so you can do this

    if (Date.DayOfWeek([Call Date],Day.Monday)<5 and (Time.Hour([Call End Time])>=7 and Time.Hour([Call End Time])<=17))then 1 else 0

    and this is what you will get