Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pasha ver
DEFINE
MEASURE factmetrica[s] =
SUM ( factmetrica[Клики] )
EVALUATE
VAR _t0 =
SUMMARIZE (
factmetrica,
FactMetrica[Поисковая фраза (Директ)]
)
VAR _t1 =
ADDCOLUMNS (
_t0,
"idx", RANKX (
_t0,
[s],
,
desc,
DENSE
),
"sum", [s]
)
VAR _t2 =
ADDCOLUMNS (
_t1,
"pct_acc",
VAR _idx = [idx]
RETURN
SUMX (
FILTER (
_t1,
[idx] <= _idx
),
[sum]
)
/ CALCULATE (
[s],
ALLSELECTED ( FactMetrica[Поисковая фраза (Директ)] )
)
)
RETURN
NATURALLEFTOUTERJOIN (
factmetrica,
_t2
)
ORDER BY [Поисковая фраза (Директ)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment