dax - PowerBI - Measure to Summarize Daily data into Monthly Counts -
i have table of defect data create measure gives me count of defects each month. know need use date table attempts far haven't worked out.
what looking when works simple count month:
january 125 february 225 march 220 april 120
here measure trying build without luck...
monthly defects = // totalytd(count(defects[defect]), 'date'[date]) var defectdate = firstdate(defects[created date]) var defectyear = year(defectdate) var defectmonth = month(defectdate) return calculate ( count(defects[defect]), filter ( defects, defects[created date] <= defectdate && (year (defects[created date]) = defectyear) && (month(defects[created date]) = defectmonth) ) )
here looking in end.
if want count per month, measure should
monthly defects=countrows(defects)
this assuming have relationship between defect table , date table.
Comments
Post a Comment