Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have total hours of work for each month this year. I would like to create a formula to have -
Total Hours / CountDaysInMonth / 12.
So let's say I have 3000 hours in January, I'd like to have a way to calculate it - 3000 / 31 / 12.
Just having a hard time figuring out how I should have it count the days of the month. I have a Date table that is connected in the Model that has Month Name and DayInWeek.
Thanks for any help!
Solved! Go to Solution.
Hi @Scaffnull
You could add a new column to the date table to store number of days in the month.
Here's some DAX to do that. You could do it in Power Query / M if you prefer.
Days in Month =
VAR _Month = MONTH('Date'[Date])
VAR _Year = YEAR('Date'[Date])
VAR _Result =
CALCULATE(
DAY(MAX('Date'[Date])),
FILTER('Date',
MONTH('Date'[Date]) = _Month && YEAR('Date'[Date]) = _Year
)
)
RETURN
_Result
Hi @Scaffnull
You could add a new column to the date table to store number of days in the month.
Here's some DAX to do that. You could do it in Power Query / M if you prefer.
Days in Month =
VAR _Month = MONTH('Date'[Date])
VAR _Year = YEAR('Date'[Date])
VAR _Result =
CALCULATE(
DAY(MAX('Date'[Date])),
FILTER('Date',
MONTH('Date'[Date]) = _Month && YEAR('Date'[Date]) = _Year
)
)
RETURN
_Result
@PaulOlding It solved it. It didn't work on my data table, but for the date table it worked like a charm. I had a month column in my data table so I just created a new column in my data table and made it related to the "Days in Month" column. Thanks again!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |