Forum Discussion

vjnvinod's avatar
vjnvinod
Icon for Impactful Individual rankImpactful Individual
5 years ago
Solved

Dax Help needed to create a calculated coloumn

Dear Experts,   I have a table called Mercury_Extract I need a calculated coloumn (Standard Available Hours) which ignores all repeated lines  except one and gives me a output as 40 It should ide...
  • v-chenwuz-msft's avatar
    5 years ago

    Hi vjnvinod,

     

    Ignore duplicate rows and only output the results for one of them. I have a method here that is worth a try, you need to create an index column first.

    In the power query editor-> add column->index column -> close and apply

    Then use this formula:

    give you 40 =
    VAR _1 =
        CALCULATE(
            MIN( [Index] ),
            FILTER(
                'Mercury_Extract',
                [Attribute] = EARLIER( Mercury_Extract[Attribute] )
                    && [Resource GPN] = EARLIER( Mercury_Extract[Resource GPN] )
            )
        )
    RETURN
        IF( [Index] = _1, 40, 0 )

     

     

    Best Regards

    Community Support Team _ chenwu zhu

     

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