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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 33 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |