SQL Server: How To Calculate Total Revenue and Total Cost

Welcome to Excel Jet Consult blog post. In this tutorial, we want to learn how to calculate Total Revenue and Total Cost on a row-by-row context. Let’s get started

In the caption below, we want to calculate Total Revenue and Total Cost

Execute the query:

select Region, Country, [Item Type], [Sales Channel], [Order Priority], [Order Date], [Order ID], [Ship Date], [Units Sold], [Unit Price], [Unit Cost], [Units Sold] * [Unit Price] as [Total Rev], [Units Sold] * [Unit Cost] as [Total Cost] from [Unique 1M Data]

From the caption below, we can see the Total Revenue and Total Cost for each line of transaction

Posted in Blog.

Leave a Reply

Your email address will not be published. Required fields are marked *