Forum Discussion

Asamadi's avatar
Asamadi
Helper I
9 years ago
Solved

Dax Formula Sum Offset

I Update

Hello, this is my formula in excel, and i want to do in dax (new column or by measure): =IFERROR(SUM(OFFSET(B7,,,-3,1)),"-")

 

how can i perform fomula in the Indicator coulm in Dax in power bi

 

Excel file link:  https://www.dropbox.com/s/fc0mineray4pd1r/Sumoffset.xlsx?dl=0

 

  • Hi Asamadi,

     

    You can create a calculated column like below:

     

    Indicator =
    IF (
        [ID] <> MIN ( [ID] ),
        CALCULATE (
            SUM ( 'Table1'[Sales] ),
            FILTER (
                'Table1',
                'Table1'[ID]
                    >= EARLIER ( 'Table1'[ID] ) - 2
                    && 'Table1'[ID] <= EARLIER ( 'Table1'[ID] )
            )
        ),
        BLANK ()
    )

     

     

    Best Regards,
    QiuyunYu

7 Replies