Last answered:

06 Oct 2023

Posted on:

05 Oct 2023

0

Resolved: Differences between using COUNTROWS & SumX

Why we use "COUNTROWS" to calculate total sales and not use SUMX function and is there a differences between them


Although COUNTROWS function counts the number of rows in the specified table, or in a table defined by an expression so why used instead of SUMX function to get total sales per colour

1 answers ( 1 marked as helpful)
Instructor
Posted on:

06 Oct 2023

0

We use COUNTROWS because each row is a sale in our case. And we need to count them, we cannot use a SUM or SUMX to count the rows. We can find out the total sales amount in color using SUMX because this is a different calculation. Total sales is number of orders whilst total sales amount is the sum of the actual amount of money people paid for all sales in a specific color let's say.

Submit an answer

  • Javascript
  • Python
  • Ruby
  • PHP
  • Java
  • C
  • C#
  • C++
  • HTML
  • SQL
  • R
  • Shell