Forum Discussion

rehansaeed2468's avatar
8 months ago
Solved

Query Exceeded Available Resource

I am getting the "Query Exceeded Available Resources" if I am using the below Measure.   VAR Alpha = 0.964783                       VAR CurrentIndex = SELECTEDVALUE('Table B'[Row Index_TableB col...
  • v-echaithra's avatar
    v-echaithra
    7 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