Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jcastr02
Post Prodigy
Post Prodigy

Time of Day grouping

I have a list of stores with respective interval (time) and Avg Volume of calls.  I am trying to acheive the columns on the right where we want to see how many of those intervals go over threshold (below example is 10).  Then see by grouping different hours of operations where the highest call volume is.  Example for this store, during the 3pm-10pm interval, there are 14 Potential 30 min. intervals and out of those, 10 intervals were over the threshold of 10 calls.   10/14= 71.4% so we would recommend that timeframe to support (since it's the max).  Any ideas on how I could achieve the below?

**NOTE the first 3 columns is what I have in Power BI - and trying to achieve the right.  I'm stumped how to get the grouping of potential time ranges and then see which timeframe is the busiest.

 

Store #IntervalAvg Volume/Interval # of Potential Intervals# Intervals Over Threshold% Intervals Over ThresholdRecommendation
808:000 8am - 10pm281760.7% 
808:301 8am - 9pm261557.7% 
809:002 8am - 3pm14750.0% 
809:3010 9am - 10pm261765.4% 
8010:002 9am - 1pm8562.5% 
8010:303 1pm - 5pm8562.5% 
8011:0012 3pm - 10pm141071.4%x
8011:3018 4pm - 7pm6233.3% 
8012:0020 9am - 5pm161062.5% 
8012:3016 11am - 7pm161168.8% 
8013:005 6pm - 9pm6350.0% 
8013:304 9am - 7pm201260.0% 
8014:0018      
8014:3019      
8015:0020      
8015:3022      
8016:009      
8016:3011      
8017:0011      
8017:3010      
8018:002      
8018:308      
8019:009      
8019:3010      
8020:0022      
8020:3015      
8021:0016      
8021:3017      
8022:0018      
8022:302      
1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

Hi @jcastr02 ,

 

Based on your description,
Please try the following steps:
1.You can create a Calcualted table.

Table = DATATABLE("# of Potential Intervals",STRING,
                    "Start",STRING,
                    "End",STRING,
                    {{"8am - 10pm","8:00","21:30"},
                     {"8am - 9pm","8:00","20:30"},
                     {"8am - 3pm","8:00","14:30"},
                     {"9am - 10pm","9:00","21:30"},
                     {"9am - 1pm","9:00","12:30"},
                     {"1pm - 5pm","13:00","16:30"},
                     {"3pm - 10pm","15:00","21:30"},
                     {"4pm - 7pm","16:00","18:30"},
                     {"9am - 5pm","9:00","16:30"},
                     {"11am - 7pm","11:00","18:30"},
                     {"6pm - 9pm","18:00","20:30"},
                     {"9am - 7pm","9:00","18:30"}}
                    )

And set the data type of the Start column and End column to Time.

vweiyan1msft_0-1706769258826.png

2.Use the following code to create Calculated Columns.

# Intervals Over Threshold = 
COUNTX (
    FILTER (
        'StoreTable',
        'StoreTable'[Interval] >= 'Table'[Start]
            && 'StoreTable'[Interval] <= 'Table'[End]
    ),
    'StoreTable'[Avg Volume/Interva]
)
% Intervals Over Threshold = 
COUNTX (
    FILTER (
        'StoreTable',
        'StoreTable'[Interval] >= 'Table'[Start]
            && 'StoreTable'[Interval] <= 'Table'[End]
            && 'StoreTable'[Avg Volume/Interva] >= 10
    ),
    'StoreTable'[Avg Volume/Interva]
)
Recommendation = 
DIVIDE (
    'Table'[% Intervals Over Threshold],
    'Table'[# Intervals Over Threshold]
)

Result is as below.

vweiyan1msft_1-1706769328404.png


Best Regards,
Yulia Yan

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

View solution in original post

1 REPLY 1
v-weiyan1-msft
Community Support
Community Support

Hi @jcastr02 ,

 

Based on your description,
Please try the following steps:
1.You can create a Calcualted table.

Table = DATATABLE("# of Potential Intervals",STRING,
                    "Start",STRING,
                    "End",STRING,
                    {{"8am - 10pm","8:00","21:30"},
                     {"8am - 9pm","8:00","20:30"},
                     {"8am - 3pm","8:00","14:30"},
                     {"9am - 10pm","9:00","21:30"},
                     {"9am - 1pm","9:00","12:30"},
                     {"1pm - 5pm","13:00","16:30"},
                     {"3pm - 10pm","15:00","21:30"},
                     {"4pm - 7pm","16:00","18:30"},
                     {"9am - 5pm","9:00","16:30"},
                     {"11am - 7pm","11:00","18:30"},
                     {"6pm - 9pm","18:00","20:30"},
                     {"9am - 7pm","9:00","18:30"}}
                    )

And set the data type of the Start column and End column to Time.

vweiyan1msft_0-1706769258826.png

2.Use the following code to create Calculated Columns.

# Intervals Over Threshold = 
COUNTX (
    FILTER (
        'StoreTable',
        'StoreTable'[Interval] >= 'Table'[Start]
            && 'StoreTable'[Interval] <= 'Table'[End]
    ),
    'StoreTable'[Avg Volume/Interva]
)
% Intervals Over Threshold = 
COUNTX (
    FILTER (
        'StoreTable',
        'StoreTable'[Interval] >= 'Table'[Start]
            && 'StoreTable'[Interval] <= 'Table'[End]
            && 'StoreTable'[Avg Volume/Interva] >= 10
    ),
    'StoreTable'[Avg Volume/Interva]
)
Recommendation = 
DIVIDE (
    'Table'[% Intervals Over Threshold],
    'Table'[# Intervals Over Threshold]
)

Result is as below.

vweiyan1msft_1-1706769328404.png


Best Regards,
Yulia Yan

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.