So using this formula WorkDaysInPeriodUntilToday = CALCULATE(COUNT('Calendar'[date]),FILTER('Calendar','Calendar'[work_day_flag]="Yes" && 'Calendar'[date]<=TODAY()))
should get what you need. This screenshot shows the monthly revenue per workday and an overall total for the months selected in the slicer.
and if only January was selected in the slicer you would get this
There are also measures that you can define that will calculate to the totals that are shown in the Matrix using the ALLSELECTED function.
Total Workdays2 = CALCULATE(COUNT('Calendar'[date]),FILTER(ALLSELECTED('Calendar'),'Calendar'[work_day_flag]="Yes" && 'Calendar'[date]<=TODAY())) --33
use a similar ALLSELECTED function on the revenue calculation Revenue2=CALCULATE(SUM(Order_Fact_Table[Amount]),ALLSELECTED('Calendar')) --36,085.42
Revenue Per Day2 = Divide(Revenue2,Total Workdays2) --1093.50
Engage and empower students with Power BI!
Continue your learning in our online communities.
Travel to Melbourne and network with thousands of peers!
Check out what's new in the Power BI Community!