Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Count if earning positive

Hi,

 

I would like to create a new measure (in percentage) regarding what is the overall stability criteria regarding earnings for multiple companies. This is the table that I have:

DateCompany_ShortcutEarnings
2008-12-31MMM720347620
2008-12-31AOS23740234
2008-12-31SO72304726502
2008-12-31OZK2346700
2009-12-31MMM720357620
2009-12-31AOS13740234
2009-12-31SO72304756502
2009-12-31OZK2349700
2010-12-31MMM720307620
2010-12-31AOS19740234
2010-12-31SO72309056502
2010-12-31OZK2399700

 

I have created already 3 measures:

EARNINGS = SUM(Earnings[Earnings])

EARNINGS LY = Calculate([EARNINGS], SAMEPERIODLASTYEAR('Date'[Date]))

Diff Earnings = IF(ISBLANK([EARNINGS LY]),BLANK(),[EARNINGS]-[EARNINGS LY])

 
What I cannot figure out is how I can caculate now the stability criterion.
I want to check if Diff Earnings is positive or negative (for each company and year) and count this.
Then the overall value should be sth like this:
Stability Earnings = COUNT([pos])/COUNT([Diff Earnings])
 
Any help is appreciated,
Sebastian
 

6 Replies