Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Aggregate Per Category

1. Average per category


2. Variance per category
3. Max per category
4. Min per category
5. Weighted Average per category

Filters

1. Filtered Value
2. Difference from filtered Value
3. Percentage difference from filtered Value
4. Sales from new customers

Time Intelligence

1. Year to date total


2. Quarter to date total
3. Month to date total
4. YOY change
5. QOQ
6. MOM
7. Rolling Average

Totals

1. Running Total
2. Total for Category (filters applied)
3. Total for Category (filters no applied)

Mathematical Operations

1. Addition
2. Subtraction
3. Multiplication
4. Division
5. Percentage difference
6. Correlation Coeffecient
Average per Category

Profit average per Segment =


AVERAGEX(
KEEPFILTERS(VALUES('Sheet1'[Segment])),
CALCULATE(SUM('Sheet1'[Profit]))
)

Profit average per Country =


AVERAGEX(
KEEPFILTERS(VALUES('Sheet1'[Country])),
CALCULATE(SUM('Sheet1'[Profit]))
)

[ Sales variance per Date] =


VARX.P(
KEEPFILTERS(VALUES('datetable'[Date])),
CALCULATE(SUM('Sheet1'[ Sales]))
)

[ Sales max per Date] =


MAXX(
KEEPFILTERS(VALUES('datetable'[Date])),
CALCULATE(SUM('Sheet1'[ Sales]))
)

[ Sales min per Product] =


MINX(
KEEPFILTERS(VALUES('financials'[Product])),
CALCULATE(SUM('financials'[ Sales]))
)
[ Sales weighted by COGS per Product] =
VAR __CATEGORY_VALUES = VALUES('financials'[Product])
RETURN
DIVIDE(
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(SUM('financials'[ Sales]) * SUM('financials'[COGS]))
),
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(SUM('financials'[COGS]))
)
)

[ Sales weighted by Profit per Product] =


VAR __CATEGORY_VALUES = VALUES('financials'[Product])
RETURN
DIVIDE(
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(SUM('financials'[ Sales]) * SUM('financials'[Profit]))
),
SUMX(
KEEPFILTERS(__CATEGORY_VALUES),
CALCULATE(SUM('financials'[Profit]))
)
)

[ Sales for Amarilla] =


CALCULATE(
SUM('financials'[ Sales]),
'financials'[Product] IN { "Amarilla" }
)
[ Sales difference from Amarilla] =
VAR __BASELINE_VALUE =
CALCULATE(
SUM('financials'[ Sales]),
'financials'[Product] IN { "Amarilla" }
)
VAR __MEASURE_VALUE = SUM('financials'[ Sales])
RETURN
IF(NOT ISBLANK(__MEASURE_VALUE), __MEASURE_VALUE - __BASELINE_VALUE)

[ Sales % difference from Amarilla] =


VAR __BASELINE_VALUE =
CALCULATE(
SUM('financials'[ Sales]),
'financials'[Product] IN { "Amarilla" }
)
VAR __MEASURE_VALUE = SUM('financials'[ Sales])
RETURN
IF(
NOT ISBLANK(__MEASURE_VALUE),
DIVIDE(__MEASURE_VALUE - __BASELINE_VALUE, __BASELINE_VALUE)
)

YTD total

[ Sales YTD] =
IF(
ISFILTERED('dimdate'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the
Power BI-provided date hierarchy or primary date column."),
TOTALYTD(SUM('financials'[ Sales]), 'dimdate'[Date].[Date])
)
[ Sales QTD] =
IF(
ISFILTERED('dimdate'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the
Power BI-provided date hierarchy or primary date column."),
TOTALQTD(SUM('financials'[ Sales]), 'dimdate'[Date].[Date])
)

[ Sales MTD 4] =
IF(
ISFILTERED('dimdate'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the
Power BI-provided date hierarchy or primary date column."),
TOTALMTD(SUM('financials'[ Sales]), 'dimdate'[Date].[Date])
)

[ Sales YoY%] =
IF(
ISFILTERED('dimdate'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the
Power BI-provided date hierarchy or primary date column."),
VAR __PREV_YEAR =
CALCULATE(
SUM('financials'[ Sales]),
DATEADD('dimdate'[Date].[Date], -1, YEAR)
)
RETURN
DIVIDE(SUM('financials'[ Sales]) - __PREV_YEAR, __PREV_YEAR)
)
[ Sales MoM%] =
IF(
ISFILTERED('dimdate'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the
Power BI-provided date hierarchy or primary date column."),
VAR __PREV_MONTH =
CALCULATE(
SUM('financials'[ Sales]),
DATEADD('dimdate'[Date].[Date], -1, MONTH)
)
RETURN
[ Sales rolling average] =
IF(
ISFILTERED('dimdate'[Date]),
ERROR("Time intelligence quick measures can only be grouped or filtered by the
Power BI-provided date hierarchy or primary date column."),
VAR __LAST_DATE = ENDOFQUARTER('dimdate'[Date].[Date])
VAR __DATE_PERIOD =
DATESBETWEEN(
'dimdate'[Date].[Date],
STARTOFQUARTER(DATEADD(__LAST_DATE, -1, QUARTER)),
ENDOFQUARTER(DATEADD(__LAST_DATE, 1, QUARTER))
)
RETURN
AVERAGEX(
CALCULATETABLE(
SUMMARIZE(
VALUES('dimdate'),
'dimdate'[Date].[Year],
'dimdate'[Date].[QuarterNo],
'dimdate'[Date].[Quarter]
),
__DATE_PERIOD
),
CALCULATE(
SUM('financials'[ Sales]),
ALL(
'dimdate'[Date].[MonthNo],
'dimdate'[Date].[Month],
'dimdate'[Date].[Day]
)
)
)
)

)
[ Sales running total in Date 2] =
CALCULATE(
SUM('financials'[ Sales]),
FILTER(
ALLSELECTED('dimdate'[Date]),
ISONORAFTER('dimdate'[Date], MAX('dimdate'[Date]), DESC)
)
)

[ Sales running total in Date 2] =


CALCULATE(
SUM('financials'[ Sales]),
FILTER(
ALLSELECTED('dimdate'[Date]),
ISONORAFTER('dimdate'[Date], MAX('dimdate'[Date]), DESC)
)
)

[ Sales total for Date 2] =


CALCULATE(SUM('financials'[ Sales]), ALL('dimdate'[Date]))

You might also like