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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mark8
Frequent Visitor

averages help

I have a table with 22,000 rows of data in a category

I have a list "Category" , "reported Date" that's it. 22,000 in my list

there are 83 different category's in my list.

try to get Average per year and month.  i don't know what i am doing wrong. 

 

thank you 

 

 

CategoryReported date
Clinical equipment / consumables26/05/2022
Documentation / health records20/12/2022
Information Governance 21/02/2022
Communication24/06/2022
Documentation / health records16/09/2022
Verbal Abuse29/12/2022
Actual Physical Assault12/09/2022
Systems of work26/09/2022
Breach of policy / protocol / procedure05/10/2022
Patient journey07/03/2022
Discharge issues/concerns05/10/2022
Discharge issues/concerns14/09/2022
Breach of policy / protocol / procedure14/09/2022
Breach of policy / protocol / procedure07/12/2022
Speech and Language Therapy04/10/2022
Flood24/10/2022
Flood24/10/2022
Treatment / procedure06/11/2022
Moisture Associated Skin Damage04/09/2022
Breach of policy / protocol / procedure18/11/2022
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

First extract Year and month from reported dateCreate Year and Month Columns

  1. In the Power Query Editor, add new columns to extract the year and month from the Reported date.
    Click on Add Column > Date > Year > Year to create a Year column.
    Click on Add Column > Date > Month > Month to create a Month column.
    Close and apply the changes to load the transformed data back into Power BI.
    • Then create a measure for AverageIncidents

      AverageIncidentsPerYear =
      DIVIDE(
      COUNTROWS('YourTableName'),
      DISTINCTCOUNT('YourTableName'[Year])
      )

       

      Similarly for month

      AverageIncidentsPerMonth =
      DIVIDE(
      COUNTROWS('YourTableName'),
      DISTINCTCOUNT('YourTableName'[Year]) * 12
      )

@Mark8




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

First extract Year and month from reported dateCreate Year and Month Columns

  1. In the Power Query Editor, add new columns to extract the year and month from the Reported date.
    Click on Add Column > Date > Year > Year to create a Year column.
    Click on Add Column > Date > Month > Month to create a Month column.
    Close and apply the changes to load the transformed data back into Power BI.
    • Then create a measure for AverageIncidents

      AverageIncidentsPerYear =
      DIVIDE(
      COUNTROWS('YourTableName'),
      DISTINCTCOUNT('YourTableName'[Year])
      )

       

      Similarly for month

      AverageIncidentsPerMonth =
      DIVIDE(
      COUNTROWS('YourTableName'),
      DISTINCTCOUNT('YourTableName'[Year]) * 12
      )

@Mark8




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.