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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
dkalina97
Helper I
Helper I

Percent Complete by Working Days

I feel like this should be a relatively simple DAX formula but I am struggling. I simply want to calculate the forecasted sales by workday in a month and compare it to actual. So if there are 20 weekdays in the month, and forecasted sales were 20,000, and today is workday 10, the forecasted sales MTD would be 20,000/20x10, or 10,000 and then compare that to actual sales. I have a date table and attempted to Countrows, but could not get that to work. 

1 ACCEPTED SOLUTION

Hi @dkalina97 

You can try this

(1) create a column in date table,

weekday = WEEKDAY('Table'[date],2)
vxiaotang_1-1637224887059.png

(2) create a measure

Measure = 
    var _allweekday = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[weekday]<6))
    var _today = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[date]<=TODAY() && 'Table'[weekday]<6))
return _today/_allweekday*20000

result

vxiaotang_0-1637224847963.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
dkalina97
Helper I
Helper I

This gives me the denominator, but what about the numerator. So if today is day 10, it will calculate 10/20 *20,000 = 10,000

Then tomorrow, it will calculate 11/20 = $11,000. And then I will compare that amount to actual sales MTD.

Hi @dkalina97 

You can try this

(1) create a column in date table,

weekday = WEEKDAY('Table'[date],2)
vxiaotang_1-1637224887059.png

(2) create a measure

Measure = 
    var _allweekday = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[weekday]<6))
    var _today = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[date]<=TODAY() && 'Table'[weekday]<6))
return _today/_allweekday*20000

result

vxiaotang_0-1637224847963.png

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@dkalina97 , for any two dates you can get workday as column like

 

COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(Table[Start Date],Table[End Date]),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1))

 

With Start and end date of month

COUNTROWS(FILTER(ADDCOLUMNS(CALENDAR(Eomonth([Date],-1)+1 ,Eomonth([Date],0) ),"WorkDay", if(WEEKDAY([Date],2) <6,1,0)),[WorkDay] =1))

 

You can also do it using calendar

How to calculate Business Days/ Workdays, with or without date table: https://youtu.be/Qv4wT8_P-AA

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.