Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I am having a hard time figuring how to calculate the number of working days already passed since the beginning of the month, as of today. The number should dynamically change everyday as a result.
I have tried using a Calendar table to differentiate the type of days, but I am lost in the way to make it work in the end, and I wonder if there isn't just a simple way to do this..
Thanks !
Solved! Go to Solution.
Hi @mperrot,
I forgot to change it.
Please see:
count working days = CALCULATE ( COUNTROWS ( 'Dim table' ), FILTER ( 'Dim table', 'Dim table'[Date].[Day] <= DAY ( TODAY () ) && 'Dim table'[Date].[MonthNo] = MONTH ( TODAY () ) && 'Dim table'[Weekday] <= 5 ) )
Best regards,
Yuliana Gu
Hi @mperrot,
Create a calendar table which lists unique continual dates, and add a calculated column to show weekday number for each date.
Weekday = WEEKDAY('Dim table'[Date],2)
Then, create a measure to get the number of working days already passed since the beginning of the month, as of today.
count working days = CALCULATE ( COUNTROWS ( 'Dim table' ), FILTER ( 'Dim table', 'Dim table'[Date].[Dia] <= DAY ( TODAY () ) && 'Dim table'[Date].[MonthNo] = MONTH ( TODAY () ) && 'Dim table'[Weekday] <= 5 ) )
Best regards,
Yuliana Gu
I am also unable to enter any of my column names (mine are called dayofmonth and monthofyear) into the formula - what am I doing wrong?
Thanks Yuliana for your help!
What are [Dia] and [MonthNo] referring to ? I get a message telling me they cannot be found in the Date Column
Hi @mperrot,
I forgot to change it.
Please see:
count working days = CALCULATE ( COUNTROWS ( 'Dim table' ), FILTER ( 'Dim table', 'Dim table'[Date].[Day] <= DAY ( TODAY () ) && 'Dim table'[Date].[MonthNo] = MONTH ( TODAY () ) && 'Dim table'[Weekday] <= 5 ) )
Best regards,
Yuliana Gu
Hi @v-yulgu-msft ,
I have that formula in my calendar. However, we report as of the prior day. On the first of the month I need to count total working days as of last month.
Example: Today is October 1 (22 working days). But, we are reporting September (21 working days).
The below does not work for me for total work days in the reporting period month. But it does when counting actual work days past in the month:
Hi iam working through this sme problem. I have calculated the number of working days er month. Happy with that.
Your line:
'Dim table'[Date].[Day] <= DAY ( TODAY () )
what is the [Date].[Day] as I do not get that option. is it a column in your date table? If so what format?
when I select my weekday (ie the column <=5) I get a returned value that is the same as the total for the month. today is the 15th, so it can not return 22 for April, which is what I am currently getting. But I can not put the dax exactly as you have it as I dont have [day]. Is it just 1 to 30?
Thank you so much for your help ! Have a great day 🙂
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
86 | |
81 | |
70 | |
49 |
User | Count |
---|---|
143 | |
124 | |
107 | |
60 | |
55 |