Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
emarome94
Helper I
Helper 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. 

 

I have created starting from this dataset a table with the below formula: 

 

Tabella =
SUMMARIZE(
    ADDCOLUMNS(
    'Fact Table',
    "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" )
    ),
    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],
    [FY2023 Revenue],
    [FY2022 Quantity],
    [FY2023 Quantity],
    [FY2022 COGS],
    [FY2023 COGS]
)

The above formula retrieve the table I want but with only a problem: the value are not roll up (I dont know which terms best describe the problem) but I have made and excel file in order to show the desired result.
 
emarome94_0-1682000275183.png

 

 
 
Could someone help me to fix the above dax formula?
 
Thank much for your precious help
 
 
1 ACCEPTED SOLUTION
johnt75
Super User
Super 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" )
)

View solution in original post

4 REPLIES 4
johnt75
Super User
Super 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" )
)

hi @johnt75 ,

 

No works, still same issue

can you share a screenshot of the dataview for my code please, I want to see what the raw table looks like.

It was working, my mistake. Thank you

 

ES

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.