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
rehansaeed2468 Try creating it as a measure
DecayFactor :=
VAR Alpha = 0.964783
VAR CurrentIndex =
SELECTEDVALUE ( 'Table B'[Row Index_TableB column] )
RETURN
POWER (
Alpha,
CurrentIndex - MIN ( 'Table B'[Row Index_TableB] )
)
NOw getting the same messsage as earlier "Query has exceeded the vaailable resources"
- Amar_Kumar10 months ago
Super User
rehansaeed2468 Try with a helper table,
IndexTable =
DISTINCT (
SELECTCOLUMNS (
'Table B',
"RowIndex", 'Table B'[Row Index_TableB]
)
)Then Add decay factor as a column
DecayFactor =
POWER ( 0.964783, [RowIndex] )Final Measure:-
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]
)
)
)this should not give you the error. If this still gives error, the issue would be data corruption or model size, not DAX logic.
- rehansaeed246810 months ago
Helper I
I f I am trying to create the Decayfactor column its not findng the [Rowindex] even though I already have the IndexTable working.
- v-echaithra10 months ago
Community Support
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