Вы находитесь на странице: 1из 22

Portafolio Slicer

Tabla

Dividends

Campo

Symbol: Contiene los productos financieros (en la Tabla Symbol viene el campo Currency, que
define el tipo de moneda en que cotizan los productos)

PayDate: Fecha de pago

DividendPerShare: Precio del producto a una fecha en Moneda origen de cotización (Viene de
Tabla Symbol)

DivPerShare1: Precio del producto en Dólar USA

Calculo:
DivPerShare1 = IF(RELATED(Symbol[Currency])=CALCULATE(VALUES(ReportCurrency[ReportCurrency]), ReportCurrency[CurrencyID]=1)

, Dividends[DividendPerShare]

, ROUND(

Dividends[DividendPerShare] *

CALCULATE(VALUES(CurrencyConv[ExchRate])

, CurrencyConv[CurrencyFrom] = RELATED(Symbol[Currency])

, FILTER(ALL(CurrencyConv[CurrencyTo]), CurrencyConv[CurrencyTo] = CALCULATE(VALUES(ReportCurrency[ReportCurrency]),


ReportCurrency[CurrencyID]=1))

, LASTNONBLANK(DatesBetween(Dates[Date], DateAdd(LastDate(Dates[Date]), -10, day), LastDate(Dates[Date]))

, CALCULATE(MAX(CurrencyConv[ExchRate])

, CurrencyConv[CurrencyFrom] = RELATED(Symbol[Currency])

, FILTER(ALL(CurrencyConv[CurrencyTo]), CurrencyConv[CurrencyTo] =
CALCULATE(VALUES(ReportCurrency[ReportCurrency]), ReportCurrency[CurrencyID]=1))

,8

DivPerShare2: Precio del producto es Dólar Can

Calculo:
DivPerShare2 = IF(RELATED(Symbol[Currency])=CALCULATE(VALUES(ReportCurrency[ReportCurrency]), ReportCurrency[CurrencyID]=2)

, Dividends[DividendPerShare]

, ROUND(

Dividends[DividendPerShare] *
CALCULATE(VALUES(CurrencyConv[ExchRate])

, CurrencyConv[CurrencyFrom] = RELATED(Symbol[Currency])

, FILTER(ALL(CurrencyConv[CurrencyTo]), CurrencyConv[CurrencyTo] =
CALCULATE(VALUES(ReportCurrency[ReportCurrency]), ReportCurrency[CurrencyID]=2))

, LASTNONBLANK(DatesBetween(Dates[Date], DateAdd(LastDate(Dates[Date]), -10, day), LastDate(Dates[Date]))

, CALCULATE(MAX(CurrencyConv[ExchRate])

, CurrencyConv[CurrencyFrom] = RELATED(Symbol[Currency])

, FILTER(ALL(CurrencyConv[CurrencyTo]), CurrencyConv[CurrencyTo] =
CALCULATE(VALUES(ReportCurrency[ReportCurrency]), ReportCurrency[CurrencyID]=2))

,8

)
Allocation

Asignación de Porcentaje objetivo

Campo Allocation: Asignación de moneda

Campo TargetPercent: Porcentaje Objetivo sobre moneda

Account

Account: Nombre de la cuenta personal y de impuestos

Nombre del banco

Moneda del banco


Tabla:Config

Campo Calculado GenDivUsed

GenDivUsed = IF(COUNTROWS(

CALCULATETABLE(VALUES(Symbol[Symbol])

, Symbol[Symbol] <> "* Cash"

, FILTER(Symbol, COUNTROWS(RELATEDTABLE(Dividends))>0)

, FILTER(Symbol, COUNTROWS(CALCULATETABLE(Trans, TransType[BookValueSign]=1))>0)

)>0,"Y", "N")

Esta relacionada con:

Tabla Symbol, campo Symbol

Tabla Dividends, Campo Symbol

Tabla Trans campo Symbol y campo TransType

Tabla TransType, Campo BookValueSign y campo Transtype


TABLA : CurrencyConv

Tipo de cambio de Dólar Canadiense a Dólar USA

Encuentra la fecha anterior a la fecha de la Cotización de la moneda

PrevDate = MAXX(

FILTER(

CALCULATETABLE(VALUES(CurrencyConv[Date])

, ALLEXCEPT(CurrencyConv, CurrencyConv[CurrencyFrom],
CurrencyConv[CurrencyTo])

, CurrencyConv[Date] < EARLIER(CurrencyConv[Date])

, CurrencyConv[Date]

)
Calcula el Delta de la cotización menos la cotización anterior

ExchRateDelta = ROUND(CurrencyConv[ExchRate] -
CALCULATE(VALUES(CurrencyConv[ExchRate]), ALLEXCEPT(CurrencyConv,
CurrencyConv[CurrencyFrom], CurrencyConv[CurrencyTo]), CurrencyConv[Date] =
EARLIER(CurrencyConv[PrevDate])), 8)

Toma la fecha del campo Date de la tabla CurrencyConv después, verifica que exista en la tabla de
date Quoteexist (Yes o No) y paso siguiente busca y extrae la fecha anterior de la tabla de Quote

PrevQuoteDate = MAXX(FILTER(CALCULATETABLE(Dates, Dates[QuotesExists]="Yes", All(Dates)),


Dates[Date]<EARLIER(CurrencyConv[Date])), Dates[Date])
Calcula el Delta de la moneda entre las fechas del cotización del campo PrevQuoteDate

ExchRateDeltaSum =
IF(Related(Dates[QuotesExists])="Yes",SUMX(CALCULATETABLE(CurrencyConv,
ALLEXCEPT(CurrencyConv, CurrencyConv[CurrencyFrom], CurrencyConv[CurrencyTo],
CurrencyConv[PrevQuoteDate])), CurrencyConv[ExchRateDelta]))
TABLA: DATES

Date: Fecha consecutive

Day – Current : Ultimo dia


Month = FORMAT([Date],"YYYY-MM")

Year = Year([Date])
Short Date = FORMAT([Date],"YY-MM-DD")

Mth-Day = FORMAT([Date],"MM-DD")
Quarter In Year = CONCATENATE("Q",FORMAT([Date],"Q"))

Quarter = CONCATENATE(CONCATENATE(FORMAT([Date],"YYYY"),"-Q"), FORMAT([Date],"Q"))


Month In Year = Month([Date])

QuotesExists = IF(COUNTROWS(RELATEDTABLE(Quotes))=0,"No","Yes")

Busca la fecha y valida que exista en la tabla Quotes y regresa (Yes o No)
Days-Last 12 = IF(AND([QuotesExists] = "Yes", [Date]>=MINX(TOPN(12, CALCULATETABLE(Dates,
Dates[QuotesExists]="Yes", All(Dates)), Dates[Date]), Dates[Date])),"Yes","No")

Days-Last 20 = IF(AND([QuotesExists] = "Yes", [Date]>=MINX(TOPN(20, CALCULATETABLE(Dates,


Dates[QuotesExists]="Yes", All(Dates)), Dates[Date]), Dates[Date])),"Yes","No")
Days-Last 30 = IF(AND([QuotesExists] = "Yes", [Date]>=MINX(TOPN(30, CALCULATETABLE(Dates,
Dates[QuotesExists]="Yes", All(Dates)), Dates[Date]), Dates[Date])),"Yes","No")

Mths-Last 12 = IF([Year]=MAX([Year]) || ([Year] = MAX([Year])-1 && [Month In Year] >


MONTH(Max([Date]))), "Yes","No")
Mths-Last 13 = IF([Year]=MAX([Year]) || ([Year] = MAX([Year])-1 && [Month In Year] >=
MONTH(Max([Date]))), "Yes","No")

Years-Current = IF([Year]=MAX([Year]), "Yes","No")


Years-Last 2 = IF([Year]>MAX([Year])-2, "Yes", "No")

Years-Last 2 = IF([Year]>MAX([Year])-2, "Yes", "No")


Years-Last 4 = IF([Year]>MAX([Year])-4, "Yes", "No")

Years-Last 5 = IF([Year]>MAX([Year])-5, "Yes", "No")


Years-Last 7 = IF([Year]>MAX([Year])-7, "Yes", "No")

Years-Last 9 = IF([Year]>MAX([Year])-9, "Yes", "No")


Last YTD = IF([Year]=MAX([Year])-1 &&
FORMAT([Date],"MMDD")<=FORMAT(MAX([Date]),"MMDD"), "Yes","No")

Mths-Last 2 = IF(MAXX(Dates, DateAdd(Dates[Date], -2, MONTH)) = Blank() ||


FORMAT(Dates[Date],"YYYYMM") > FORMAT(MAXX(Dates, DateAdd(Dates[Date], -2,
MONTH)),"YYYYMM"), "Yes","No")
Mths-Current = IF(FORMAT([Date],"YYYY-MM") = FORMAT(MAX([Date]), "YYYY-MM"),"Yes","No")

Days-Last 5 = IF(AND([QuotesExists] = "Yes", [Date]>=MINX(TOPN(5, CALCULATETABLE(Dates,


Dates[QuotesExists]="Yes", All(Dates)), Dates[Date]), Dates[Date])),"Yes","No")
Years-Last 3 = IF([Year]>MAX([Year])-3, "Yes", "No")

Days-Last 10 = IF(AND([QuotesExists] = "Yes", [Date]>=MINX(TOPN(10, CALCULATETABLE(Dates,


Dates[QuotesExists]="Yes", All(Dates)), Dates[Date
Day In Year = COUNTROWS(DatesBetween(Dates[Date], Date(Dates[Year], 1, 1), Dates[Date]))