Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi everyone, I have a problem.
I have the following database:
I want to create a measure that returns the % of sales of each customer within their state but I don't know how. Can anyone help me??
Solved! Go to Solution.
hi @FelipMark
just noticed you expected a measure, try like:
measure =
DIVIDE(
SUM(data[SALE]),
SUMX(
FILTER(
ALL(data),
data[State]=MAX(data[State])
),
data[Sale]
)
)
it worked like:
hi @FelipMark
try to add a calculated column like:
Column =
DIVIDE(
[SALE],
SUMX(
FILTER(
data,
data[State]=EARLIER(data[State])
),
data[Sale]
)
)
it worked like:
Is that so?
not working, the error says the following:
EARLIER/EARLIEST references a previous row context that does not exist.
hi @FelipMark
just noticed you expected a measure, try like:
measure =
DIVIDE(
SUM(data[SALE]),
SUMX(
FILTER(
ALL(data),
data[State]=MAX(data[State])
),
data[Sale]
)
)
it worked like:
It worked! Thanks
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |