Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli


Le diverse versioni di misure Transactions in PowerPivot: una panoramica - Prof. Bergamasc, Sbobinature di Sistemi Informatici

Una panoramica delle diverse versioni di misure transactions in powerpivot, incluse transactions, transactions to bachelors, all transactions e all transactions bachelors. Inoltre, viene discusso come calcolare misure di vendite diverse, come sales, sales bachelors, all sales e all sales bachelors, utilizzando funzioni come sum, sumx, filter e related. Vengono inoltre forniti esercizi per illustrare l'utilizzo di queste funzioni.

Tipologia: Sbobinature

2023/2024

In vendita dal 14/03/2024

meg-venturi
meg-venturi 🇮🇹

2 documenti

1 / 2

Toggle sidebar

Questa pagina non è visibile nell’anteprima

Non perderti parti importanti!

bg1
LECTURE 04/03/2024
Different versions of the measure Transactions in PowerPivot:
- Transaction: this measure is simply taking any filter that we’re creating with the Pivot
- Transaction to Bachelors: still passive against the filters (colors and english
education), but given the rows the table is exposing due to the filters, in this measure
we’re taking a subset of them. We’re selecting between the visible rows, only the
rows with a specific feature
- ALL Transactions: complete indifference towards the filters, it counts all the rows of
the table
- ALL Transactions Bachelors: still ignore the filters, but inject the selection with a filter
function (EnglishEducation=Bachelors).
Variations of Sales measure:
- Sales: =SUM(Sales[Sales Amount])
- Sales Bachelors: =
we can’t use the SUM function, since it only accepts a column name. That’s an
issue, since I need to use a FILTER function and we can’t do a SUM on a FILTER.
The SUM has a maximum argument count of one/it only accepts one input.
When we use the SUM function, the software in reality internally calls another
function, which is called SUMX This function asks first for a table, to go row by
row, and row by row it can compute an expression.
ex. Pretend we don’t have the SalesAmount column, but only a column with UnitPrice
and a column with OrderQuantity.
We should calculate the product between UnitPrice and OrderQuantity to find the
revenue row by row and then sum the results at the end. This is what SUMX does.
Iterators: functions that go by row in a table, calculate something in every row, keep
in memory the results and then sum/make the average/…
SUM SUMX
AVERAGE AVERAGEX
MIN MINX
MAX MAXX
Variations of Sales measure without the SalesAmount column:
-Sales: = SUMX(Sales,Sales[UnitPrice]*Sales[OrderQuantity])
SUMX creates a temporary column in memory in which calculates in every row the
amount of sales, aggregates that with a sum, gives me the result and then the column is
pf2

Anteprima parziale del testo

Scarica Le diverse versioni di misure Transactions in PowerPivot: una panoramica - Prof. Bergamasc e più Sbobinature in PDF di Sistemi Informatici solo su Docsity!

LECTURE 04/03/

Different versions of the measure Transactions in PowerPivot:

  • Transaction: this measure is simply taking any filter that we’re creating with the Pivot
  • Transaction to Bachelors: still passive against the filters (colors and english education), but given the rows the table is exposing due to the filters, in this measure we’re taking a subset of them. We’re selecting between the visible rows, only the rows with a specific feature
  • ALL Transactions: complete indifference towards the filters, it counts all the rows of the table
  • ALL Transactions Bachelors: still ignore the filters, but inject the selection with a filter function (EnglishEducation=Bachelors). Variations of Sales measure:
  • Sales: =SUM(Sales[Sales Amount])
  • Sales Bachelors: = → we can’t use the SUM function, since it only accepts a column name. That’s an issue, since I need to use a FILTER function and we can’t do a SUM on a FILTER. The SUM has a maximum argument count of one/it only accepts one input. When we use the SUM function, the software in reality internally calls another function, which is called SUMX → This function asks first for a table, to go row by row, and row by row it can compute an expression. ex. Pretend we don’t have the SalesAmount column, but only a column with UnitPrice and a column with OrderQuantity. We should calculate the product between UnitPrice and OrderQuantity to find the revenue row by row and then sum the results at the end. This is what SUMX does. Iterators : functions that go by row in a table, calculate something in every row, keep in memory the results and then sum/make the average/… SUM → SUMX AVERAGE → AVERAGEX MIN → MINX MAX → MAXX Variations of Sales measure without the SalesAmount column:
  • Sales : = SUMX(Sales,Sales[UnitPrice]*Sales[OrderQuantity]) → SUMX creates a temporary column in memory in which calculates in every row the amount of sales, aggregates that with a sum, gives me the result and then the column is

gone. SUMX exposes the table, so that we can apply on the table FILTER and ALL and allows us to make variations/ to manipulate the table.

- Sales to Bachelors: =SUMX(FILTER(Sales;RELATED(Customer[EnglishEducation])="Bachelors");Sales[UnitPrice]Sales[ OrderQuantity]) We give to SUMX as table the subset of the rows visible in the current context referring to the Bachelors customers and on this table it compute the expression UnitPriceOrderQuantity row by row. At the end, the function computes the sum of all the values and we have the total Sales to Bachelors. - ALL Sales: =SUMX(ALL(Sales),Sales[UnitPrice]Sales[OrderQuantity]) We give to SUMX a table that ignore the filters, thanks to the ALL function, and then we want it to compute the expression UnitPriceOrderQuantity on it. - ALL Sales Bachelors: =SUMX(FILTER(ALL(Sales);RELATED(Customer[EnglishEducation])=”Bachelors”);Sales[Un itPrice]Sales[OrderQuantity]) Exercise: Transactions without using COUNTROWS =SUMX(Sales; 1) With this code, every row will have 1 as value and at the end, summing all the values of each row, we will have the number of rows. Exercise: Sales only of the rows with price higher than 5 =SUMX(FILTER(Sales;Sales[UnitPrice]>5);Sales[UnitPrice]Sales[OrderQuantity])