Forum Discussion
Hemanth96
3 years agoFrequent Visitor
Datesbetween function not working with harvested slicers
Hi, I'm new to Power BI and trying to build a measure to calculate no. of records which have dates between week start date and week end date. I have created a slicer with calendar dates and harvest...
v-yadongf-msft
3 years agoCommunity Support
Hi Hemanth96 ,
This is my test table:
Calendar table:
Create a measure:
Measure = CALCULATE(COUNT('Table'[Submitted date]),DATESBETWEEN('Table'[Submitted date],MIN('CalendarTable'[Date]),MAX('CalendarTable'[Date])))
Result:
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hemanth96
3 years agoFrequent Visitor
Thanks Yadong, but how do I get the count of dates only between 1/1/2022 and 6/1/2022 ?
- v-yadongf-msft3 years agoCommunity Support
Hi Hemanth96 ,
Measure = CALCULATE(COUNT('Table'[Submitted date]),DATESBETWEEN('Table'[Submitted date],MIN('CalendarTable'[Date]),DATE(2022,6,1)))Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Hemanth963 years agoFrequent Visitor
The main goal is - I want the user to have flexibility to select the date ranges (start and end date); and my calendar dates start from 2019, so both start and end dates have to be flexible for the user.