March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
I am trying to do an avg number of records per month but I only want it to count through the last complete month. In other words, if today is 11/8/2024, I want it to only count records through 10/31/2024.
My table has below two columns
RecordID Created
Solved! Go to Solution.
To calculate the average number of records per month up to the last completed month in Power BI, you can follow these steps:
Create a new column to extract the month and year from the Created column:
MonthYear = FORMAT('YourTable'[Created], "YYYY-MM")
Create a measure to count the records up to the last completed month:
TotalRecords =
CALCULATE(
COUNT('YourTable'[RecordID]),
'YourTable'[Created] < EOMONTH(TODAY(), -1) + 1
)
Create a measure to count the distinct months up to the last completed month:
DistinctMonths =
CALCULATE(
DISTINCTCOUNT('YourTable'[MonthYear]),
'YourTable'[Created] < EOMONTH(TODAY(), -1) + 1
)
Create a measure to calculate the average number of records per month:
AvgRecordsPerMonth =
DIVIDE([TotalRecords], [DistinctMonths])
Replace 'YourTable' with the actual name of your table. These steps will give you the average number of records per month up to October 31, 2024.
Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!
To calculate the average number of records per month up to the last completed month in Power BI, you can follow these steps:
Create a new column to extract the month and year from the Created column:
MonthYear = FORMAT('YourTable'[Created], "YYYY-MM")
Create a measure to count the records up to the last completed month:
TotalRecords =
CALCULATE(
COUNT('YourTable'[RecordID]),
'YourTable'[Created] < EOMONTH(TODAY(), -1) + 1
)
Create a measure to count the distinct months up to the last completed month:
DistinctMonths =
CALCULATE(
DISTINCTCOUNT('YourTable'[MonthYear]),
'YourTable'[Created] < EOMONTH(TODAY(), -1) + 1
)
Create a measure to calculate the average number of records per month:
AvgRecordsPerMonth =
DIVIDE([TotalRecords], [DistinctMonths])
Replace 'YourTable' with the actual name of your table. These steps will give you the average number of records per month up to October 31, 2024.
Best Regards
Saud Ansari
If this post helps, please Accept it as a Solution to help other members find it. I appreciate your Kudos!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
127 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |