Forum Discussion

Orman01's avatar
Orman01
Frequent Visitor
1 year ago
Solved

AVERAGE USER PER 30 MINUTE INTERVAL THAT CAN BE FILTERED BY MULTIPLE COLUMNS

Hi Everyone! I tried creating an average users per status per interval however I can create the average for overall but cannot be filtered by groupings. Sharing a sample raw and dax that I've created:


RAW TABLE:

GROUPNAMESTATUS START DATE/TIMESTATUS END DATE/TIMESTATUS30min Interval_START30min Interval_ENDdate_time_interval_startdate_time_interval_end 
Group1User24006/24/2025 10:33:1506/24/2025 10:34:10Busy10:30:0010:30:0006/24/2025 10:30:0006/24/2025 10:30:00 
Group1User24006/24/2025 08:34:3006/24/2025 08:41:00Busy08:30:0008:30:0006/24/2025 08:30:0006/24/2025 08:30:00 
Group1User24006/24/2025 08:26:3206/24/2025 08:34:28Busy08:00:0008:30:0006/24/2025 08:00:0006/24/2025 08:30:00 
Group1User23906/24/2025 15:00:0006/24/2025 15:14:41Break15:00:0015:00:0006/24/2025 15:00:0006/24/2025 15:00:00 
Group1User9306/24/2025 14:30:3506/24/2025 14:45:56Break14:30:0014:30:0006/24/2025 14:30:0006/24/2025 14:30:00 
Group1User14906/24/2025 15:15:0606/24/2025 15:30:38Break15:00:0015:30:0006/24/2025 15:00:0006/24/2025 15:30:00 
Group1User14906/24/2025 14:46:0106/24/2025 14:51:03Break14:30:0014:30:0006/24/2025 14:30:0006/24/2025 14:30:00 
Group1User14906/24/2025 09:37:1106/24/2025 09:52:13Break09:30:0009:30:0006/24/2025 09:30:0006/24/2025 09:30:00 
Group14User10506/24/2025 11:22:5706/24/2025 14:01:42Online11:00:0014:00:0006/24/2025 11:00:0006/24/2025 14:00:00 
Group14User10506/24/2025 08:58:1906/24/2025 11:01:29Online08:30:0011:00:0006/24/2025 08:30:0006/24/2025 11:00:00 
Group14User10506/24/2025 07:03:2306/24/2025 08:37:16Online07:00:0008:30:0006/24/2025 07:00:0006/24/2025 08:30:00 
Group14User10506/24/2025 06:02:3006/24/2025 06:56:39Online06:00:0006:30:0006/24/2025 06:00:0006/24/2025 06:30:00 

 

INTERVAL TABLE:

INTERVAL = SUMMARIZE(RAW,RAW[Date],RAW[30min Interval_START])
Added Date Time Interval =  INTERVAL[Date]+ INTERVAL[30min Interval_START]
Added Online, Busy, Break Column: 
Online Column =
var _result = CALCULATE (
    COUNTROWS (DISTINCT(RAW[NAME])),
    FILTER (
        RAW,
        RAW[STATUS] = "Online"
        && INTERVAL[Date Time Interval] >= RAW[date_time_interval_start]
        && INTERVAL[Date Time Interval] <= RAW[date_time_interval_end]
    )
)
return
IF(ISBLANK(_result),0,_result)
 

 

Added Online, Busy and Break Measures:

Online =
var _result = CALCULATE(AVERAGE(INTERVAL[Online Column]))
return
IF(ISBLANK(_result),0,_result)

 

 

GOAL:
Column= Status
ROW= 30min Interval
VALUES = average users during the interval per status (meaning it should also consider the in between of start time and end time of status) example: if the user is online from 1:30:00 to 2:30:00, he should also appear on interval 2:00:00)

 

 

 

Thank you in advance

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Orman01 ,
    Thanks for the follow-up and apologies for the delay.
    Attached the updated .pbix file. 
    Please revert back if it doesn't meet your needs or for any further adjustments.

    Thank you.

20 Replies

  • Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.

     

    Need help uploading data? click here

     

    Want faster answers? click here

    • Orman01's avatar
      Orman01
      Frequent Visitor

      Thanks for pointing that out. Updated the post. Let me know if the updated one will do. Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Orman01 ,
    Thanks for reaching out to Microsoft Fabric Community and sharing the details.

    I tried to reproduce using the RAW data you provided, but couldn’t match the expected results.

     

    If possible, please share a sample PBIX file(without any sensitive data) along with the expected output image. That would allow us to better understand the model structure, relationships, and measures used, and assist you more effectively.

    You can upload PBIX to your OneDrive or GoogleDrive and share the link here with permissions to edit.

    Please follow this guide to share sample data: How to provide sample data in the Power BI Forum - Microsoft Fabric Community

     

    Or if you found a solution, please consider sharing it here to help others who have similar requirement.

    Thank you.

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Orman01 ,
    We’re following up on your query and would be happy to assist further if needed. To help us provide more accurate support, please consider sharing a sample .pbix file with all sensitive data removed.
    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Orman01 ,
    We wanted to kindly follow up regarding your query. If you need any further assistance, please reach out. To help us provide more accurate support, please consider sharing a sample .pbix file with all sensitive data removed. Or, if you have found solution elsewhere, please share here so that others with similar scenario would benefit 
    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Orman01 ,
    Just following up on your query.  If you need any further assistance, please reach out. To help us provide more accurate support, please consider sharing a sample .pbix file with all sensitive data removed. Or, if you have found solution elsewhere, please share here so that others with similar scenario would benefit 
    Thank you.