Forum Discussion
emarome94
3 years agoHelper I
Summarizing - Grouping values in a calculate table
Hi guys, Please need your help in this topic. I have a star schema with classic sales/cost/volume values as a fact table and some other dimension table with product, time, country, ecc. ...
- 3 years ago
Try
Tabella = ADDCOLUMNS ( SUMMARIZE ( 'Fact Table', Dim_Date[FP Month Number], Dim_Country[Country], FactTable[Customer N], FactTable[Customer], FactTable[P&L Line ], FactTable[Material N], Dim_Material[Material Desc] ), "FY2022 Revenue", CALCULATE ( [Revenue], Dim_Date[Fiscal Year] = "FY2022" ), "FY2023 Revenue", CALCULATE ( [Revenue], Dim_Date[Fiscal Year] = "FY2023" ), "FY2022 Quantity", CALCULATE ( [Volume], Dim_Date[Fiscal Year] = "FY2022" ), "FY2023 Quantity", CALCULATE ( [Volume], Dim_Date[Fiscal Year] = "FY2023" ), "FY2022 COGS", CALCULATE ( SUM ( ICMI[COGS] ), Dim_Date[Fiscal Year] = "FY2022" ), "FY2023 COGS", CALCULATE ( SUM ( ICMI[COGS] ), Dim_Date[Fiscal Year] = "FY2023" ) )
johnt75
3 years agoSuper User
Try
Tabella =
ADDCOLUMNS (
SUMMARIZE (
'Fact Table',
Dim_Date[FP Month Number],
Dim_Country[Country],
FactTable[Customer N],
FactTable[Customer],
FactTable[P&L Line ],
FactTable[Material N],
Dim_Material[Material Desc]
),
"FY2022 Revenue", CALCULATE ( [Revenue], Dim_Date[Fiscal Year] = "FY2022" ),
"FY2023 Revenue", CALCULATE ( [Revenue], Dim_Date[Fiscal Year] = "FY2023" ),
"FY2022 Quantity", CALCULATE ( [Volume], Dim_Date[Fiscal Year] = "FY2022" ),
"FY2023 Quantity", CALCULATE ( [Volume], Dim_Date[Fiscal Year] = "FY2023" ),
"FY2022 COGS", CALCULATE ( SUM ( ICMI[COGS] ), Dim_Date[Fiscal Year] = "FY2022" ),
"FY2023 COGS", CALCULATE ( SUM ( ICMI[COGS] ), Dim_Date[Fiscal Year] = "FY2023" )
)