Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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