123 lines
3.0 KiB
Plaintext
123 lines
3.0 KiB
Plaintext
table 'analytics forecast'
|
||
|
||
measure Выручка =
|
||
|
||
SUMX(
|
||
'analytics forecast',
|
||
VAR Price = RELATED('Номенклатура'[Цена учетная, руб])
|
||
VAR TN = RELATED('Номенклатура'[%ТН год, руб.]) // если эта таблица есть
|
||
RETURN
|
||
'analytics forecast'[value] * IF(ISBLANK(Price), 0, Price) * (1 + IF(ISBLANK(TN), 0, TN))
|
||
)
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Сумм. учет' =
|
||
|
||
SUMX(
|
||
'analytics forecast',
|
||
VAR Price = RELATED('Номенклатура'[Цена учетная, руб])
|
||
//VAR TN = RELATED('Номенклатура'[%ТН год, руб.]) // если эта таблица есть
|
||
RETURN
|
||
'analytics forecast'[value] * IF(ISBLANK(Price), 0, Price) //* (1 + IF(ISBLANK(TN), 0, TN))
|
||
)
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure ТН = 'analytics forecast'[Выручка] - 'analytics forecast'[Сумм. учет]
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
column id
|
||
dataType: int64
|
||
formatString: 0
|
||
summarizeBy: sum
|
||
sourceColumn: id
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
column scenario_id
|
||
dataType: int64
|
||
formatString: 0
|
||
summarizeBy: none
|
||
sourceColumn: scenario_id
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
column code
|
||
dataType: string
|
||
summarizeBy: none
|
||
sourceColumn: code
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
column month
|
||
dataType: dateTime
|
||
formatString: Long Date
|
||
summarizeBy: none
|
||
sourceColumn: month
|
||
|
||
changedProperty = DataType
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
annotation UnderlyingDateTimeDataType = Date
|
||
|
||
column value
|
||
dataType: double
|
||
summarizeBy: sum
|
||
sourceColumn: value
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
column updated_at
|
||
dataType: dateTime
|
||
formatString: General Date
|
||
summarizeBy: none
|
||
sourceColumn: updated_at
|
||
|
||
variation Изменение
|
||
isDefault
|
||
relationship: 8d64ceb3-2d4c-432b-bcbf-9e73a511289d
|
||
defaultHierarchy: LocalDateTable_7e7e5dfb-3918-439e-8cc1-8e832260b631.'Иерархия дат'
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
column updated_by
|
||
dataType: string
|
||
summarizeBy: none
|
||
sourceColumn: updated_by
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
column opt
|
||
dataType: double
|
||
summarizeBy: sum
|
||
sourceColumn: opt
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
column mp
|
||
dataType: double
|
||
summarizeBy: sum
|
||
sourceColumn: mp
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
partition 'analytics forecast' = m
|
||
mode: import
|
||
source =
|
||
let
|
||
Источник = Sql.Databases("prdsql"),
|
||
mag_pbi = Источник{[Name="mag_pbi"]}[Data],
|
||
analytics_forecast = mag_pbi{[Schema="analytics",Item="forecast"]}[Data]
|
||
in
|
||
analytics_forecast
|
||
|