Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Ezhilmathi
Frequent Visitor

Workday count in M Query

Hi All,

 

I am working on Dim_Calendar to identify the workday and weekend day and lable them with the month day say (1,2,3,....) from the 1st working day of the month. For example, if the first day of the month starts on sunday (weekend), then the month day should be 0 and should start from the second day (monday) as 1. We should not consider the weekends in between the dates in the month and count the workdays continuously. I have a solution to do this using DAX formula. But I need it to be done in the backend through M Query. Kindly do let me know on the solution.

 

The solution needed should be as in the below table column D.

Ezhilmathi_0-1674826798245.png

 

Would greatly appreciate any help!

 

2 REPLIES 2
amitchandak
Super User
Super User

@Ezhilmathi ,

 

Create a new column

 

Countx(filter(Date, Date[Is WorkDay] ) , Date[Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

Thanks for your response. I would want this column to be created in the backend i.e using m query in query editor. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.