Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
11 | |
11 | |
8 |
User | Count |
---|---|
24 | |
18 | |
12 | |
11 | |
10 |