Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a montly target of 1,000 hours and would like to break that down to a daily target that only increases on weekdays (Mon to Friday).
What I've been able to do by myself is break down the 1000 hours into a daily target (1000 hours / # of weekdays in the month) * Current day of the month. Unfortunately, this results in the daily target being too high. The other option I tried was (1000 hours / # of days in the current month) * day of the current month. This resulted in a target which is too low. I'm trying to find a happy "medium" by forcing the sum to rise only on weekdays.
Solved! Go to Solution.
What you want is 1000 hrs * ( # weekdays so far this month ) / ( # weekdays in the month ).
This is easier to calculate if you have an IsWeekday column on your date dimension table. For example,
IsWeekday = IF ( WEEKDAY ( Dim_Date[Date] ) IN { 2, 3, 4, 5, 6 }, 1, 0 )
You'll also want a column that groups the dates into months. For example,
MonthEnd = EOMONTH ( Dim_Date[Date], 0 )
Then your target might look like this (if it were a calculated column):
Target =
VAR CurrDate = Dim_Date[Date]
VAR CurrMonth = Dim_Date[MonthEnd]
VAR SubTable = FILTER ( Dim_Date, Dim_Date[MonthEnd] = CurrMonth )
RETURN
1000
* DIVIDE (
SUMX ( FILTER ( SubTable, Dim_Date[Date] <= CurrDate ), Dim_Date[IsWeekday] ),
SUMX ( SubTable, Dim_Date[IsWeekday] )
)
I am the OP and I didn't mark the post suggested as the solution, as the solution. I did get some inspiration from the post but didn't really use it.
Here is what worked for me - I use the date table from "Enterprise DNA" which you can read about here:
Extended Date Table Power Query M Function - Enterprise DNA
If you use the same date table, you can follow most of my formula below exactly.
Here is the measure that converts a montly target to a daily target, that only goes up on work days of the month. Note that "Monthly Hours Target'[Target Month]" is the column in the "target" table which has the target month in it (Jan, Feb, etc..). "Monthly Hours Target'[Target Hours]" is the column in the target table which has the hours in it.
I just drop this measure onto a bar chart, along with the "Target" and, each work day, the daily target will rise according to the workday of the month.
I am the OP and I didn't mark the post suggested as the solution, as the solution. I did get some inspiration from the post but didn't really use it.
Here is what worked for me - I use the date table from "Enterprise DNA" which you can read about here:
Extended Date Table Power Query M Function - Enterprise DNA
If you use the same date table, you can follow most of my formula below exactly.
Here is the measure that converts a montly target to a daily target, that only goes up on work days of the month. Note that "Monthly Hours Target'[Target Month]" is the column in the "target" table which has the target month in it (Jan, Feb, etc..). "Monthly Hours Target'[Target Hours]" is the column in the target table which has the hours in it.
I just drop this measure onto a bar chart, along with the "Target" and, each work day, the daily target will rise according to the workday of the month.
What you want is 1000 hrs * ( # weekdays so far this month ) / ( # weekdays in the month ).
This is easier to calculate if you have an IsWeekday column on your date dimension table. For example,
IsWeekday = IF ( WEEKDAY ( Dim_Date[Date] ) IN { 2, 3, 4, 5, 6 }, 1, 0 )
You'll also want a column that groups the dates into months. For example,
MonthEnd = EOMONTH ( Dim_Date[Date], 0 )
Then your target might look like this (if it were a calculated column):
Target =
VAR CurrDate = Dim_Date[Date]
VAR CurrMonth = Dim_Date[MonthEnd]
VAR SubTable = FILTER ( Dim_Date, Dim_Date[MonthEnd] = CurrMonth )
RETURN
1000
* DIVIDE (
SUMX ( FILTER ( SubTable, Dim_Date[Date] <= CurrDate ), Dim_Date[IsWeekday] ),
SUMX ( SubTable, Dim_Date[IsWeekday] )
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |