I have an report in SSRS that counts items used every month but some months are missing because no items were used that month.
=count(Fields!Drug.Value)
ie Jan=2, Mar=1, Apr=3, June=4
I would like the month grouping to appear and the count to display a '0' if there is no data for a particular month.
ie Jan=2, Feb=0, Mar=1, Apr=3, May=0, June=4
If have tried an IsNothing expression but it still doesn't display '0' for months with no data.
=IIF(IsNothing(count(Fields!Drug.Value)),0, count(Fields!Drug.Value))
'SELECT Distinct case when month(BagDoseStartDateTime) between 7 and 12 then cast(right(year(BagDoseStartDateTime),2) as varchar(10)) + '/' + cast(right(year(BagDoseStartDateTime) + 1,2) as varchar(10)) else cast(right(year(BagDoseStartDateTime) - 1,2) as varchar(10)) + '/' + cast(right(year(BagDoseStartDateTime),2) as varchar(10)) end as FinancialYear ,year(BagDoseStartDateTime) as YearAdministered ,month(BagDoseStartDateTime) as MonthAdministered ,D.[Drug] ,D.[BagDoseStartDateTime]
FROM CAB_Reporting.dbo.CAB_V_Doses_Bags D --Inner join CAB_Reporting.dbo.CAB_V_Dose_Actions DA on DA.PatientID = D.PatientID
Where ((year(BagDoseStartDateTime) = 2016 and month(bagDoseStartDateTime) >6) or (year(BagDoseStartDateTime) = 2017)) And ((D.Drug Like 'Red Blood Cells (1 Unit)' And D.Status Like 'Administered') Or (D.Drug Like 'Fresh Frozen Plasma (FFP 1 Unit)' And D.Status Like 'Administered') Or (D.Drug Like'Cryoprecipitate (Multiple Units)' And D.Status Like 'Administered') Or (D.Drug Like 'Platelets (1 Unit)' And D.Status Like 'Administered')) Order by year(BagDoseStartDateTime) ,month(BagDoseStartDateTime)'