Forum Discussion

WishAskedSooner's avatar
WishAskedSooner
Continued Contributor
1 year ago
Solved

Generating a Lookup Table Help

HI Experts!   I am having difficulty generating a lookup table that I need for later processing in a measure. Here is a sample of my requirement and the problem.   I have the following table call...
  • Nasif_Azam's avatar
    1 year ago

    Hey WishAskedSooner ,

    It looks like the issue is coming from how the AVERAGEX function is being used. Try the DAX expression:

     

    VAR _AvgNewVal =
        SUMMARIZE(
            'Fact',
            'Fact'[AID],
            "AVG NEW VAL", AVERAGEX(
                FILTER(
                    _NewVal, 
                    'Fact'[AID] = EARLIER('Fact'[AID])
                ),
                [NEWVAL]
            )
        )

     

    If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


    Best Regards,
    Nasif Azam