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
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |