Forum Discussion

saqwild's avatar
saqwild
Frequent Visitor
2 years ago
Solved

Calculating the amount from a helper table.

Hello Everyone. The code I borrwed from This video. I have two tables now, one with my master datad as following.   Account Number Account Name Transaction Date Description Amount 11111...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, saqwild 

    If you want to use measure. you can try the following DAX:

    Base Amount with Percent measure = 
    VAR DaysDiff = MAX('Master'[Days])
    VAR _Percent =
        CALCULATE (
            MAX ( 'Grid'[Percent] ),
            FILTER ( 'Grid', DaysDiff >= 'Grid'[Min] && DaysDiff <= 'Grid'[Max] )
        )
    RETURN
        MAX('Master'[Amount]) * _Percent

     

    Here is my preview:

     

    How to Get Your Question Answered Quickly

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.