Forum Discussion
ecoale
8 years agoHelper I
Students variations year over year
Good morning, I need help....... I have imported (by Excel) a dataset "Students", with 3 coloumns: Student ID, Sex (M/F) and Year (from 2009 to 2016). Thanks to the Power BI Matrix item...
- 8 years ago
You may refer to the following measure.
Measure = VAR y = SELECTEDVALUE ( Students[Year] ) VAR prev = CALCULATE ( COUNT ( Students[Student ID] ), Students[Year] = y - 1 ) RETURN IF ( NOT ( ISBLANK ( prev ) ), COUNT ( Students[Student ID] ) - prev ) - 8 years ago
v-chuncz-msft
8 years agoCommunity Support
You may refer to the following measure.
Measure =
VAR y =
SELECTEDVALUE ( Students[Year] )
VAR prev =
CALCULATE ( COUNT ( Students[Student ID] ), Students[Year] = y - 1 )
RETURN
IF ( NOT ( ISBLANK ( prev ) ), COUNT ( Students[Student ID] ) - prev )
- ecoale8 years agoHelper I
My friend thanks a lot, it works!
But is is not correct: it gives me the difference beetween the two numbers, but I would need the quotient.
Infact, at the moment, for example for the females (F), I have these counts of students (por year):
2009 2010 2011 2012 2013 2014 2015 2016
232 223 186 166 153 177 192 218
-9 -37 -20 -13 24 15 26
I would need the measure gave me, for example not 223 - 232 = -9.
But ( (223 / 232) * 100) ) - 100 = 96,1 - 100 = -3,9
May you help me again??
Thank you!
- v-chuncz-msft8 years agoCommunity Support
- ecoale8 years agoHelper I
THanks a lot my friend!
It works! :)
My sincear best regards