analytics/pbi/report/Model/tables/analytics forecast.tmdl
2026-02-22 15:39:05 +03:00

123 lines
3.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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