Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Dear Power BI Representative,
I am reviewing the Choosing between IF and DIVIDE section of the 'Definitive Guide to DAX' Chapter 20.
When I try to run the DAX expression I receive an error message regarding the Sales table.
I do not understand why this query is not functioning. Please advise.
Thank you.
DEFINE
MEASURE Sales[Average Price (slow)] =
VAR Quantity = SUM ( Sales[Quantity] )
VAR SalesAmount = [Sales Amount]
VAR Result =
IF (
Quantity <> 0,
SalesAmount / Quantity
)
RETURN result
EVALUATE
TOPN (
502,
SUMMARIZECOLUMNS (
ROLLUPADDISSUBTOTAL(
ROLLUPGROUP(
Customer[CustomerKey],
'Product[Brand]
), "IsGrandTotalRowTotal"
),
"Average_Price_slow_",'Sales'[Average Price (slow)]
),
[IsGrandTotalRowTotal], 0,
'Customer'[CustomerKey], 1,
'Product'[Brand], 1
)
ORDER BY
[IsGrandTotalRowTotal] DESC,
'Customer'[CustomerKey],
'Product'[Brand]
Solved! Go to Solution.
Hi, @lt79_Pax
A single quotation mark(‘)should be added after the product table name.
ROLLUPGROUP ( Customer[CustomerKey], 'Product'[Brand] )
Is this the result you want? Hope this is useful to you
Please feel free to let me know If you have further questions
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @lt79_Pax
A single quotation mark(‘)should be added after the product table name.
ROLLUPGROUP ( Customer[CustomerKey], 'Product'[Brand] )
Is this the result you want? Hope this is useful to you
Please feel free to let me know If you have further questions
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
| User | Count |
|---|---|
| 60 | |
| 46 | |
| 32 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 82 | |
| 68 | |
| 43 | |
| 26 | |
| 23 |