Forum Discussion

Peter_'s avatar
Peter_
Icon for Resolver I rankResolver I
7 years ago
Solved

Filtering a measure doesn't work in Aggregated Context

Hi,   I've created a Measure which calculates another measure with an applied filter, but the filtering is incorrect in an aggregated context. Any suggestions? Note that the nested measure definiti...
  • Peter_'s avatar
    Peter_
    7 years ago

    I think I've found a solution using an inner join which gives 1 in the test sampleset. Thanks Kristjan76 for giving me a hint why it wasn't working.

    [Enabled Devices: [Devices]] + Enabled 2] =
    VAR tbl = ADDCOLUMNS(SUMMARIZE( Table1,
    Table1[Device],
    "Number of Enabled Sessions", CALCULATE(SUM(Table1[Sessions]), Table1[Is Enabled] = true),
    "Number of All Sessions", SUM(Table1[Sessions])),

    "Percentage of Enabled Sessions", DIVIDE([Number of Enabled Sessions], [Number of All Sessions]))
    RETURN
    CALCULATE([Devices], FILTER(NATURALINNERJOIN(tbl, Table1), [Percentage of Enabled Sessions] >= 0.5))