Forum Discussion
DISTINCTCOUNT with one compulsory Condition
- 5 years ago
Please try this formula below which is similar to what I have previously posted.
Count of Years for Project ID in 2020 =
VAR _2020 =
CALCULATE (
COUNT ( 'Fact'[Year] ),
FILTER ( ALLEXCEPT ( 'Fact', 'Fact'[Project ID] ), 'Fact'[Year] = 2020 )
)
RETURN
COUNTX ( SUMMARIZE ( 'Fact', 'Fact'[Project ID], 'Fact'[Year], "value", _2020 ), [value] )
You should be able to get this result return the numbers of years for S. IDs 1, 3 & 5.
Arshadjehan , You data format is not clear you can have measure like
calculate(coutrows(Table), filter(Table, Table[year]=2020))
Can use year or year without time intelligence
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Thanks amitchandak for the response.
But your suggested measure will filter only projects of 2020. I need a measure which could give me number of years a project is there is the list and is still in the list (last year of every project is 2020).