Forum Discussion
Data coverage based on fiscal year
Hi
I have a table of companies and the fiscal year in which data is available. I am trying to count the numbers of companies that have data in all of 2016 ,2017 and 2018 on the dashboard. Please advise, thank you!
| companyid | FiscalYear |
| 222135 | 2011 |
| 222135 | 2011 |
| 222135 | 2011 |
| 222135 | 2011 |
| 222135 | 2012 |
| 222135 | 2012 |
| 222135 | 2012 |
| 222135 | 2012 |
| 222135 | 2012 |
| 222135 | 2013 |
| 222135 | 2013 |
| 222135 | 2013 |
| 222135 | 2013 |
| 222135 | 2013 |
| 222135 | 2013 |
| 222135 | 2014 |
| 222135 | 2014 |
| 222135 | 2014 |
| 222135 | 2014 |
| 222135 | 2014 |
| 222135 | 2014 |
| 222135 | 2014 |
| 222135 | 2015 |
| 222135 | 2015 |
| 222135 | 2015 |
| 222135 | 2015 |
| 222135 | 2015 |
| 222135 | 2015 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222135 | 2017 |
| 222327 | 2011 |
| 222327 | 2011 |
| 222327 | 2011 |
| 222327 | 2011 |
| 222327 | 2012 |
| 222327 | 2012 |
| 222327 | 2012 |
| 222327 | 2012 |
| 222327 | 2012 |
| 222327 | 2013 |
| 222327 | 2013 |
| 222327 | 2013 |
| 222327 | 2013 |
| 222327 | 2013 |
| 222327 | 2014 |
| 222327 | 2014 |
| 222327 | 2014 |
| 222327 | 2014 |
| 222327 | 2014 |
| 222327 | 2015 |
| 222327 | 2015 |
| 222327 | 2015 |
| 222327 | 2015 |
| 222327 | 2015 |
| 222327 | 2016 |
| 222327 | 2016 |
| 222327 | 2016 |
| 222327 | 2016 |
| 222327 | 2016 |
| 222327 | 2016 |
| 222327 | 2016 |
| 222327 | 2017 |
| 222327 | 2017 |
| 222327 | 2017 |
| 222327 | 2017 |
| 222327 | 2017 |
| 222327 | 2018 |
| 222327 | 2018 |
| 222327 | 2018 |
| 222327 | 2018 |
| 222327 | 2018 |
| 222327 | 2018 |
| 224055 | 2011 |
| 224055 | 2011 |
| 224055 | 2012 |
| 224055 | 2012 |
| 224055 | 2013 |
| 224055 | 2013 |
| 224055 | 2014 |
| 224055 | 2014 |
| 224055 | 2015 |
| 224055 | 2015 |
| 224055 | 2016 |
| 224055 | 2016 |
| 224055 | 2017 |
| 224055 | 2017 |
| 224055 | 2018 |
| 224055 | 2018 |
| 224991 | 2011 |
| 224991 | 2011 |
| 224991 | 2012 |
| 224991 | 2012 |
| 224991 | 2012 |
| 224991 | 2012 |
| 224991 | 2012 |
| 224991 | 2013 |
| 224991 | 2013 |
| 224991 | 2013 |
| 224991 | 2013 |
| 224991 | 2013 |
| 224991 | 2014 |
| 224991 | 2014 |
| 224991 | 2014 |
| 224991 | 2014 |
| 224991 | 2014 |
| 224991 | 2015 |
| 224991 | 2015 |
| 224991 | 2015 |
| 224991 | 2015 |
| 224991 | 2015 |
| 224991 | 2016 |
| 224991 | 2016 |
| 224991 | 2016 |
| 224991 | 2016 |
| 224991 | 2016 |
| 224991 | 2017 |
| 224991 | 2017 |
| 224991 | 2017 |
| 224991 | 2017 |
| 224991 | 2017 |
| 224991 | 2018 |
| 224991 | 2018 |
| 224991 | 2018 |
| 224991 | 2018 |
| 224991 | 2018 |
| 228399 | 2011 |
| 228399 | 2012 |
| 228399 | 2013 |
| 228399 | 2014 |
| 228399 | 2015 |
| 228399 | 2016 |
| 228399 | 2017 |
| 228399 | 2018 |
| 228591 | 2011 |
| 228591 | 2011 |
| 228591 | 2011 |
| 228591 | 2011 |
| 228591 | 2011 |
| 228591 | 2011 |
| 228591 | 2012 |
| 228591 | 2012 |
| 228591 | 2012 |
| 228591 | 2012 |
| 228591 | 2012 |
| 228591 | 2012 |
| 228591 | 2013 |
| 228591 | 2013 |
| 228591 | 2013 |
| 228591 | 2013 |
| 228591 | 2013 |
| 228591 | 2013 |
| 228591 | 2014 |
| 228591 | 2014 |
| 228591 | 2014 |
| 228591 | 2014 |
| 228591 | 2014 |
| 228591 | 2015 |
| 228591 | 2015 |
| 228591 | 2015 |
| 228591 | 2015 |
| 228591 | 2015 |
| 228591 | 2015 |
| 228591 | 2016 |
| 228591 | 2016 |
| 228591 | 2016 |
| 228591 | 2016 |
| 228591 | 2016 |
| 228591 | 2017 |
| 228591 | 2017 |
| 228591 | 2017 |
| 228591 | 2017 |
| 228591 | 2017 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
| 228591 | 2018 |
Hi Anonymous
try this
Measure = COUNTROWS ( FILTER ( SUMMARIZE ( FILTER ( ALL ( 'Table' ), 'Table'[FiscalYear] IN { 2016, 2017, 2018 } ), 'Table'[companyid], "@Cnt", DISTINCTCOUNT ( 'Table'[FiscalYear] ) ), [@Cnt] = 3 ) )Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.
5 Replies
- mwegener
Most Valuable Professional
Hi Anonymous ,
try this.
Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support. - AnonymousNot applicable
mwegener This is not what I'm looking for actually. I am looking for companies that have all years of data for 2016, 2017 and 2018. In my example, there are 5 companies that fit such scenario, but I don't know how to calculate systemically. By Distinct Count, it only shows me data coverage of each year, and the total means number of companies that have data in at least one year, but I want to count companies that have data in all of the years.
- mwegener
Most Valuable Professional
Hi Anonymous
try this
Measure = COUNTROWS ( FILTER ( SUMMARIZE ( FILTER ( ALL ( 'Table' ), 'Table'[FiscalYear] IN { 2016, 2017, 2018 } ), 'Table'[companyid], "@Cnt", DISTINCTCOUNT ( 'Table'[FiscalYear] ) ), [@Cnt] = 3 ) )Regards,
Marcus
Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.- AnonymousNot applicable
Great! This works perfectly. Thank you!
- v-lili6-msft
Community Support
hi Anonymous
Just use this logic to create a measure
Measure 4 = SUMX ( VALUES ( 'Table'[companyid] ), IF ( 2016 IN CALCULATETABLE ( VALUES ( 'Table'[FiscalYear] ) ) && 2017 IN CALCULATETABLE ( VALUES ( 'Table'[FiscalYear] ) ) && 2018 IN CALCULATETABLE ( VALUES ( 'Table'[FiscalYear] ) ), 1, 0 ) )Result:
Regards,
Lin