Forum Discussion
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
- Greg_DecklerCommunity Champion
I would think:
Measure = IFERROR(SUM([Column]),"-")
?
https://msdn.microsoft.com/en-us/library/ee634765.aspx
- mechanix85Helper I
It is necessary to calculate the amount regardless of the order of the output of the ID column, that is, if the sort is applied, the amount should change?
- AsamadiHelper INew file Uploaded: https://www.dropbox.com/s/fc0mineray4pd1r/Sumoffset.xlsx?dl=0
- v-qiuyu-msftCommunity Support
Hi Asamadi,
I'm not able to download the Excel file as that site is blocked due to policy. Would you please upload the Excel to OneDrive or Dropbox and share it here again if other two communities' post don't meet your requirement?
Best Regards,
QiuyunYu- AsamadiHelper I
New file Uploaded:
https://www.dropbox.com/s/fc0mineray4pd1r/Sumoffset.xlsx?dl=0- v-qiuyu-msftCommunity Support
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