Forum Discussion
JamesBurke
2 years agoHelper III
Rank x
Hi All, Measure 12 = CALCULATE(RANKX(ALL('Emporia Devices'[Device name KP]),CALCULATE(SUM('Emporia Device Usage'[Usages KWH])),,DESC,Dense)) Count of Rank 1 = CALCULATE...
- 2 years ago
Not sure how this is any better?
lbendlin
2 years agoSuper User
please explain what you expect instead
JamesBurke
2 years agoHelper III
Hi lbendlin ,
It's just the first value if you look below
Ranked =
var s = SELECTEDVALUE('Emporia Devices'[Device name KP])
var a = ADDCOLUMNS(ALL('Date'[Mth & Yr]),"kwh",CALCULATE(sum('Emporia Device Usage'[Usages Kwh]),'Emporia Devices'[Device name KP]=s))
var b = ADDCOLUMNS(a,"r",var d = [Mth & Yr] return [Max Month Rank])
return
countrows(filter(b,[r]=SELECTEDVALUE(Ranks[Value])))
On the Left is all the MTH & YR where there are Data Hoever it says180 + Rank 1's ,
CALCULATE(
MAX('Date'[Year Month Number]),
FILTER('Date',[UsagesCount] >= 1),
ALL('Date'))UsagesCount = CALCULATE(COUNTROWS('Emporia Device Usage'))This filters all date to months only where are data but i'm not sure how to implement this into the Measure.
Thanks , James.