Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Wajahat_Kayani
Frequent Visitor

A table of multiple values was supplied where a single value was expected.

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 :-

 

SalesTable =
VAR Brand = VALUES('Product'[Brand])
VAR Category = VALUES('Product'[Category])
VAR ProductName = VALUES('Product'[Product Name])
VAR Qty = CALCULATE(SUM(Sales[Quantity]))
VAR UnitPrice = CALCULATE(SUM(Sales[Unit Price]))

VAR Result =
    SUMMARIZECOLUMNS(
        Sales,
        'Product',
        "Brands" , Brand,
        "Category", Category,
        "Product Name" , ProductName,
        "Qty", Qty,
        "Unit Price" , UnitPrice,
        "Amount" , Qty * UnitPrice
    )
RETURN Result

 

Expected Result :-

BrandCategoryProductQtyUnit PriceAmount
abcaamango2003.5720
pmocdcar10200020000
xyzlcbed5035017500
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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]

vyiruanmsft_1-1707207247614.png

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

vyiruanmsft_0-1707207162246.png

Best Regards

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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]

vyiruanmsft_1-1707207247614.png

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

vyiruanmsft_0-1707207162246.png

Best Regards

danextian
Super User
Super User

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

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

thanks @danextian for repling but your solution didn't meet my requirement. but it works for known. 

 

danextian
Super User
Super User

Hi @Wajahat_Kayani 

 

Just to make sure, you are entering this as a calculated table and not as a measure, yeah?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian,

Thanks for reply, 

Yes i am using calculated table.

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors