Forum Discussion
Make A Formula With Dates.
Hi DouglasWatkins ,
According to your description, here's my solution.
1.Count distinct IDs in all the years. Create a measure.
Measure =
CALCULATE ( DISTINCTCOUNT ( 'Table'[ID] ) )
Result:
2.Count distinct IDs in each year. Create a measure.
Measure2 =
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID] ),
YEAR ( 'Table'[Dates] ) = YEAR ( MAX ( 'Table'[Dates] ) )
)
Result:
3.Count distinct IDs in each fiscal year. First create a calculated column.
FiscalYear =
IF ( MONTH ( [Dates] ) < 7, YEAR ( [Dates] ), YEAR ( [Dates] ) + 1 )
Then create a measure:
Measure3 =
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID] ),
'Table'[FiscalYear] = MAX ( 'Table'[FiscalYear] )
)
Result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- DouglasWatkins4 years agoFrequent Visitor
I tried yours but it's not working. I think the issus is that my data table doesn't have a complete date range of January 1st to December 31st.
- lbendlin4 years ago
Super User
It doesn't need to. What needs to have a complete range of dates is the Calendar table in your data model. If you don't have that then you need to add one.