cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nattiej101
Helper II
Helper II

How many months in a filter

I am trying to calculate how many months are in a filter....  I have the total days in the filter, but each month has a different number of days.  How should I code the Total Months in Filter measure?
 
Total Days in Filter =
var _maxDate = MAXX(ALLSELECTED('public view_transactions'), 'public view_transactions'[date].[Date])
var _minDate = MINX(ALLSELECTED('public view_transactions'), 'public view_transactions'[date].[Date])
return
DATEDIFF(_minDate, _maxDate, DAY) +2
1 ACCEPTED SOLUTION
nattiej101
Helper II
Helper II

Total Months in Filter = DATEDIFF(min('public view_transactions'[DateDay]), MAX('public view_transactions'[DateDay]),Month) + 1

View solution in original post

1 REPLY 1
nattiej101
Helper II
Helper II

Total Months in Filter = DATEDIFF(min('public view_transactions'[DateDay]), MAX('public view_transactions'[DateDay]),Month) + 1

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors