Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

item no wise Last 3 Transaction filter with posting date

Item wise select last 3 transaction from posting date filter ,below mentioned Example Actaul record and excepted answer record   Example: Actual Record: Item No Posting date A 28-11-19 ...
  • V-lianl-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    First you need to create a date table that is not associated as a slicer.
    Then you need to enter "edit queries" to create an index column as the sorting condition, and you need to sort the date before creating the index column.
    Then create the measure and apply the filter

    Measure =
        IF (
            MAX ( test[Posting date] ) <= SELECTEDVALUE ( 'Table'[Posting date] ),
            RANKX (
                FILTER (
                    ALLEXCEPT ( test, test[Item No] ),
                    test[Posting date] <= SELECTEDVALUE ( 'Table'[Posting date] )
                ),
               [measure2],
                ,
                DESC
            )
        )

    You can also refer to the pbix

     

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