Forum Discussion

yforti's avatar
yforti
Icon for Helper II rankHelper II
2 years ago
Solved

Help with dax formula

Hi guys! I need to create a measure that counts column "Repetidos" only once per order number (NroPedido2). Currently the measurement is repeated for all lines. As we can see in the image ...
  • VahidDM's avatar
    2 years ago

    HI yforti 

     

    Try this:

    Repetidos = 
    VAR UniqueOrdersPerDay = 
        SUMMARIZE(
            iFrame,
            iFrame[NroPedido2],
            iFrame[DateSession - Copiar],
            "OrderCount", COUNTROWS(iFrame)
        )
    VAR RepeatedOrders = 
        SUMMARIZE(
            UniqueOrdersPerDay,
            [NroPedido2],
            "DaysCount", COUNTROWS(UniqueOrdersPerDay)
        )
    RETURN
        COUNTROWS(
            FILTER(
                RepeatedOrders,
                [DaysCount] > 1
            )
        )

     

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

    Appreciate your Kudos!! 

    LinkedIn | Twitter | Blog | YouTube