Forum Discussion
Distinct count total over date range
Hi,
Assuming you have:
- A Calendar Table with a relationship from the Date column of your Tasks Table to the Date column of your Calendar Table
- In the Calendar Table there will be a Year and Month column
- To your visual, you have dragged Year and Month from the Calendar Table
Write these measures
Distinct tasks = DISTINCTCOUNT('Tasks'[Number])
Distinct tasks final = COUNTROWS(FILTER(SUMMARIZE(VALUES('Tasks'[Number]),'Tasks'[Number],"Count since inception",CALCULATE([Distinct tasks],DATESBETWEEN(Calendar[Date],MINX(ALL(Calendar[Date]),Calendar[Date]),MAX(Calendar[Date]))),[Count since inception]=1))
Hope this helps.
- sbalish7 years agoFrequent Visitor
Hi! Thanks for the tip. Yes to all 3 assumptions. Added the Distinct Task Final measure...error popped up expecting another argument for the FILTER command...I think it needs a FilterExperssion? Also...it was underlining the [Count since inception]=1 part at the end...do I need to add that as a new column in my table?
Thanks!
- sbalish7 years agoFrequent Visitor
I see it...needed another right ) just after the MAX(Calendar[Date] part...
Distinct tasks final = COUNTROWS(FILTER(SUMMARIZE(VALUES('Tasks'[Number]),'Tasks'[Number],"Count since inception",CALCULATE([Distinct tasks],DATESBETWEEN(Calendar[Date],MINX(ALL(Calendar[Date]),Calendar[Date]),MAX(Calendar[Date])))),[Count since inception]=1))
Unfortunately this measure returns the same count totals.
Tasks Started Final (417...still incorrect)
- Ashish_Mathur7 years agoSuper User
Hi,
Share the link from where i can download your PBI file.