Forum Discussion
Query Exceeded Available Resource
- 10 months ago
Hi rehansaeed2468 ,
Create the helper table first:
IndexTable =
DISTINCT (
SELECTCOLUMNS (
'Table B',
"RowIndex", 'Table B'[Row Index_TableB]))
Now create the DecayFactor column inside IndexTable (not Table B):DecayFactor =
POWER ( 0.964783, IndexTable[RowIndex] )
This will work because of no circular dependency.
Final Measure =
VAR CurrentIndex =
SELECTEDVALUE ( 'Table B'[Row Index_TableB column] )RETURN
IF (
ISBLANK ( CurrentIndex ),
BLANK (),
SUMX (
FILTER (
IndexTable,
IndexTable[RowIndex] <= CurrentIndex
),
IndexTable[DecayFactor]
* CALCULATE (
SUM ( 'Table B'[Product Cost] ),
'Table B'[Row Index_TableB] = IndexTable[RowIndex]
)))
Hope this helps.
Chaithra E
I f I am trying to create the Decayfactor column its not findng the [Rowindex] even though I already have the IndexTable working.
Hi rehansaeed2468 ,
Create the helper table first:
IndexTable =
DISTINCT (
SELECTCOLUMNS (
'Table B',
"RowIndex", 'Table B'[Row Index_TableB]))
Now create the DecayFactor column inside IndexTable (not Table B):
DecayFactor =
POWER ( 0.964783, IndexTable[RowIndex] )
This will work because of no circular dependency.
Final Measure =
VAR CurrentIndex =
SELECTEDVALUE ( 'Table B'[Row Index_TableB column] )
RETURN
IF (
ISBLANK ( CurrentIndex ),
BLANK (),
SUMX (
FILTER (
IndexTable,
IndexTable[RowIndex] <= CurrentIndex
),
IndexTable[DecayFactor]
* CALCULATE (
SUM ( 'Table B'[Product Cost] ),
'Table B'[Row Index_TableB] = IndexTable[RowIndex]
)))
Hope this helps.
Chaithra E