Forum Discussion
Mith
3 years agoRegular Visitor
Current Month vs Previous Month
Hi, I was using the below Dax formula for current month and previous month month last 9 months and giving me the accurate answer. Today i noticed after refreshed the data, in my report for CM and...
- 3 years ago
This should work now.
Current month Female = VAR _current_month = MONTH ( EOMONTH ( TODAY (), -1 ) ) VAR _current_year = Year ( EOMONTH ( TODAY (), -1 ) ) RETURN CALCULATE ( [Female_App], FILTER ( Applicant, INT(MONTH ( Applicant[Added Date] )) = INT(_current_month) && INT(YEAR ( Applicant[Added Date] )) = INT(_current_year) ) )previous month Female = VAR _current_month = MONTH ( EOMONTH ( TODAY (), -2 ) ) VAR _current_year = Year ( EOMONTH ( TODAY (), -2 ) ) RETURN CALCULATE ( [Female_App], FILTER ( Applicant, INT(MONTH ( Applicant[Added Date] )) = INT(_current_month) && INT(YEAR ( Applicant[Added Date] )) = INT(_current_year) ) )
Samarth_18
Community Champion
3 years agoThis should work now.
Current month Female =
VAR _current_month =
MONTH ( EOMONTH ( TODAY (), -1 ) )
VAR _current_year =
Year ( EOMONTH ( TODAY (), -1 ) )
RETURN
CALCULATE (
[Female_App],
FILTER (
Applicant,
INT(MONTH ( Applicant[Added Date] )) = INT(_current_month)
&& INT(YEAR ( Applicant[Added Date] )) = INT(_current_year)
)
)previous month Female =
VAR _current_month =
MONTH ( EOMONTH ( TODAY (), -2 ) )
VAR _current_year =
Year ( EOMONTH ( TODAY (), -2 ) )
RETURN
CALCULATE (
[Female_App],
FILTER (
Applicant,
INT(MONTH ( Applicant[Added Date] )) = INT(_current_month)
&& INT(YEAR ( Applicant[Added Date] )) = INT(_current_year)
)
)
Mith
3 years agoRegular Visitor
thanks you now this dax works for me.
thank you so much for your help.