Forum Discussion
kyleldi
9 years agoFrequent Visitor
Counting data between two date ranges
I have a delivery table that contains a date column and a status column. I'm looking to graph that data by status by month and rolling week. The data appears correctly on the Data Detail table I ma...
Phil_Seamark
9 years agoMicrosoft Employee
- kyleldi9 years agoFrequent Visitor
Phil_Seamark Here's my code for the OTD table.
OTD = DISTINCT('vw_PBI-OnTimeDelivery'[Shipped_Date (bins)])- Anonymous9 years agoNot applicable
Hi kyleldi,
If you want to get the distinct count of selected date range, you can try to use below formula:
Count of Selected DateRange= var selectedMin=FIRSTDATE(ALLSELECTED('Table'[Date])) var selectedMax=LASTDATE(ALLSELECTED('Table'[Date])) return CALCULATE(DISTINCTCOUNT('vw_PBI-OnTimeDelivery'[Shipped_Date (bins)]),FILTER(ALL('Table'),[Date]>=selectedMin&&[Date]<=selectedMax))Notice: table is the source table of the date slicer.
Regards,
Xiaoxin Sheng