Forum Discussion

mccollough's avatar
mccollough
Icon for Helper I rankHelper I
5 years ago
Solved

Average Frequency by Hour Calculation

Hello Everyone!   Penny for your thoughts   Fact Table Exam Id                 Report Date            Report Hour             Employee                  Location                    Task T...
  • parry2k's avatar
    5 years ago

    mccollough here are 3 measures to get this going. these are self-explanatory but if you need further details, let me know.

     

    Count Exams = COUNTROWS ( Exam1 )  //exam1 is a name of the table in my model
    
    Number of Days = CALCULATE ( DISTINCTCOUNT ( Exam1[Report Date] ), ALLSELECTED () )
    
    Avg per Hour = 
    VAR __examDays = Exam1[Number of Days]
    RETURN
    SUMX (  
        SUMMARIZE ( 
            Exam1, 
            Exam1[Report Hour], 
            Exam1[Task Type], 
            "@AVG",  DIVIDE ( [Count Exams], __examDays ) 
        ), 
        [@AVG] 
    )

     

    Follow us on LinkedIn

     

    Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.