muddu83
muddu83

Reputation: 495

Power BI calculation measure for a month's forecasted data

I have a forecasted manhours data for the month of December. I would like to calculate a measure in Power BI which could show me the forecast on a daily basis. Eg.: Dec has 31 days and total forecast is 300 hours. The visual should show me data refreshed on a daily basis for that particular day. Dec 1 will be 300 hours/31 days = 9.67 hrs ; Dec 2 will be 300 hours/30days = 10 hrs and so on Dec 31 will be 300 hours/1 day = 300 hrs.

Upvotes: 0

Views: 134

Answers (1)

msta42a
msta42a

Reputation: 3741

You Can try with ENDOFMONTH and DAY function.

DAY -> Returns the day of the month, a number from 1 to 31.

ENDOFMONTH -> Returns the end of month.

Code may looks like:

Forecast = 'Table'[ForecastHours] / ( DAY(ENDOFMONTH('Calendar'[date])) -  ( DAY('Calendar'[date]) - 1 )

Upvotes: 1

Related Questions