Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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] )
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
19 | |
12 | |
11 | |
10 | |
6 |
User | Count |
---|---|
20 | |
20 | |
19 | |
14 | |
10 |