Power BI: calculate a specific criteria automatically for the current month

This formula allows me to calculate a particular criteria for the current month in an automatic way instead to use manually the filter option (it can be used also to calculate the current year). I mean, imagine, we are in September and I want to know how many P1 in this current month, I can use the filter, in this case, next month, manually, I have to change the filter. This formula will do automatically without using the filter.

CALCULATE(CALCULATE(COUNT('table'[argument1]),'table'[argument2]="xxx"),
MONTH('table'[argument3])=MONTH(TODAY()))

For the current year, just replace “month” by “year”.

For instance:

CALCULATE(CALCULATE(COUNT('incident'[Number]),'incident'[Priority]="P1"),
MONTH('incident'[Month])=MONTH(TODAY()))

Interesting Management