The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
there is an example in Microsoft training modules 2-aggregation-iterator-functions . and in the higher grain summarization part, it gives a formula:
Revenue Avg Order =
AVERAGEX(
VALUES('Sales Order'[Sales Order]),
[Revenue]
)
where [Revenue] is:
Revenue =
SUMX(
Sales,
Sales[Order Quantity] * Sales[Unit Price] * (1 - Sales[Unit Price Discount Pct])
)
lets put them together:
Revenue Avg Order =
AVERAGEX(
VALUES('Sales Order'[Sales Order]),
SUMX(
Sales,
Sales[Order Quantity] * Sales[Unit Price] * (1 - Sales[Unit Price Discount Pct])
)
)
my question is:
is the formula above the same as this one? why?
(I test these two formulas and find them return the same result in my data model. )
Revenue Avg Order2 =
AVERAGEX (
VALUES('Sales Order'[Sales Order]),
SUMX (
FILTER(Sales, Sales[Sales Order] = EARLIER('Sales Order'[Sales Order])),
Sales[Order Quantity] * Sales[Unit Price] * (1 - Sales[Unit Price Discount Pct])
)
)
Solved! Go to Solution.
chatgpt gives an answer as follows:
chatgpt gives an answer as follows:
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |