Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Error :- A table of multiple values was supplied where a single value was expected.
How can i get the expected result shown below using dax.
DAX Query :-
Expected Result :-
| Brand | Category | Product | Qty | Unit Price | Amount |
| abc | aa | mango | 200 | 3.5 | 720 |
| pmo | cd | car | 10 | 2000 | 20000 |
| xyz | lc | bed | 50 | 350 | 17500 |
Solved! Go to Solution.
Hi @Wajahat_Kayani ,
You can follow the steps below to get the expected result, please find the details in the attachment.
1. Assume that there is one relationship between the table 'Product' and 'Sales' base on the field [Product Name]
2. Create a measure as below to get the amount
Amount = SUM('Sales'[Qty])*SUM('Sales'[Unit Price])
3. Create a table visual which applied the field 'Product'[Brand],'Product'[Category],'Product'[Product Name] and the field 'Sales'[Quantity],Sales[Unit Price] with the aggregation function SUM
Best Regards
Hi @Wajahat_Kayani ,
You can follow the steps below to get the expected result, please find the details in the attachment.
1. Assume that there is one relationship between the table 'Product' and 'Sales' base on the field [Product Name]
2. Create a measure as below to get the amount
Amount = SUM('Sales'[Qty])*SUM('Sales'[Unit Price])
3. Create a table visual which applied the field 'Product'[Brand],'Product'[Category],'Product'[Product Name] and the field 'Sales'[Quantity],Sales[Unit Price] with the aggregation function SUM
Best Regards
Hi @Wajahat_Kayani ,
SUMMARIZECOLUMNS does not accept a table unlike SUMMARIZE. Also, are you supposed to aggregate the unit price as well instead of itemizing it and m ultiplying it by qty? Anway, play around with this.
SalesTable =
VAR Qty =
CALCULATE ( SUM ( Sales[Quantity] ) )
VAR Result =
SUMMARIZE (
'Product',
'Product'[Brand],
'Product'[Category],
'Product'[Product Name],
Sales[Unit Price],
"Qty", Qty,
"Amount", Qty * Sales[Unit Price]
)
RETURN
Result
thanks @danextian for repling but your solution didn't meet my requirement. but it works for known.
Just to make sure, you are entering this as a calculated table and not as a measure, yeah?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.