Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Create a new flag column with subquery filtering

Team, Can someone please help me with the below request? I have a SalesTransaction table like below. I need to create a Flag column with this condition.   Condition: First I have to find the Trans...
  • v-easonf-msft's avatar
    v-easonf-msft
    4 years ago

    Hi, Anonymous 

    You can try to  create a calculated column as below and apply it as a visual filter.

    New Flag =
    VAR _tab1 =
        SUMMARIZE (
            FILTER ( ALLSELECTED ( SalesTransaction ), SalesTransaction[ACCOUNT ID] = 3 ),
            SalesTransaction[TRANSACTION ID]
        )
    RETURN
        IF (
            COUNTROWS (
                FILTER (
                    _tab1,
                    SalesTransaction[Transaction ID] = EARLIER ( SalesTransaction[Transaction ID] )
                )
            ) > 0,
            TRUE (),
            FALSE ()
        )
    

     

    Best Regards,
    Community Support Team _ Eason
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.