DAX Calculation Giving Error

I am working through the Ultimate Beginner PowerBi Class and when I try to create the Revenues equation it won’t let me reference anything in the sales table.

I tried:
Revenues = Sales[Quantity] * Sales[Prices] but i get the error that the sales table has a column that can’t be aggregated. I don’t know why.
Practice UBG Report.pbix (478.4 KB)

It is doing the same thing in the provided completed pbix file that is part of the resource pack.

I have all the tables and model set up exactly like the class.

Hello @NukeNDO,

Thank You for posting your query onto the Forum.

Are you simply referencing the naked columns from the Sales table? In that case, it’s bound to give an error. While creating a measure, one cannot call-out naked columns from the table. Wrap them inside the iterator i.e., in this case “SUMX()” function. Like this -

Total Sales =
SUMX(
    Sales , Sales[Price] * Sales[Quantity] )

And you’ll see the results as expected -

I’m also attaching the working of the PBIX file alongwith the link of a video from the education portal for the reference purposes.

Hoping you find this useful and meets your requirements that you’ve been looking for.

Thanks and Warm Regards,
Harsh

Practice UBG Report - Harsh.pbix (478.6 KB)

I rewatched the video and realized he was creating a calculated column first then showing the easier method of creating a measure using SUMX. I am all good now.