Count left working days in current month

joslaz

Board Regular
Joined
May 24, 2018
Messages
76
Good day everybody,


I am facing a relatively trivial problem, but somehow I can not continue.


Aussprache lernen
I would like to know how (dax measure) many working days are still available in the current business month from today (in Excel/ Power Pivot).



I have the following table:
DateB_MonthWorkday
01.01.2019Jan0
02.01.2019Dec1

<tbody>
</tbody>


As you can see, the business month is different from the normal month.

Code:
=VAR CurrentDay = MAX('Calendar'[Date])
VAR CurrentMonth = MAX('Calendar'[B_Month])
RETURN
CALCULATE('Calendar'[Workday];
FILTER(ALL('Calendar'[Date]); 'Calendar'[Date] <= CurrentDay &&
 'Calendar'[B_Month] = CurrentMonth))



I constantly receive only any error messages.


Does somebody has any idea?

Best Regards
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Your CALCULATE doesn't have an operator like SUM(). Assuming all your other logic and relationships are good...
 
Upvote 0
Thanks for your replay!

I have developed the following approach that works:
Code:
=VAR LastDayOfCurrentMonth = MAX('Calendar'[Date])Return
CALCULATE(
    COUNTROWS('Calendar');
    FILTER('Calendar';'Calendar'[Date] >= TODAY() && 'Calendar'[Date] <= LastDayOfCurrentMonth);
    FILTER('Calendar'; 'Calendar'[Workday]>= 0,5))

What do you think?
Are there any potential issues?
 
Upvote 0

Forum statistics

Threads
1,215,187
Messages
6,123,540
Members
449,107
Latest member
caya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top