Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |