Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |