Forum Discussion
Days Between Dates Issue
- 4 years ago
Hi, Anonymous
You can solve your problem with measure, mainly because you need to calculate the second date.
Maesure:
Days between date = DATEDIFF ( DATE ( YEAR ( TODAY () ), 1, 1 ), DATE ( YEAR ( TODAY () ), SELECTEDVALUE ( 'Date'[Date].[MonthNo] ) + 1, 1 ) - 1, DAY )Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous For the first parameter, use DATE(2022,1,1). Also you can get the number of days between 2 dates using simple subtraction:
([date1] - [date2]) * 1.
Hey Greg,
Thanks for the tips, but that doesn't quite solve my current predicament. See below screenshot:
When I select 2022-02 on my slicer, I want to see days passed between January 1 and Februrary 28th (59 days total). Currently, when I select 2022-02, I only get January's days (31). I want January + February (59 days).
Thanks,
Joel