Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
3 years ago
Solved

Lowest Sale Date

Good!! Someone knows how to identify the lowest sale date in a year. I have a sales table and calendar. I need to know what was the lowest selling day during the year.

Thank you

  • Hi, Syndicate_Admin 

     

    If it's more than a year, you can try the following.

    Measure = 
    VAR _minsales =
        CALCULATE ( MIN ( 'Table'[Sales] ), ALLEXCEPT ( 'Date', 'Date'[Year] ) )
    RETURN
        CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER ( ALL ( 'Table' ), [Sales] = _minsales ),
            FILTER ( ALL ( 'Date' ), [Year] = SELECTEDVALUE ( 'Date'[Year] ) )
        )

    Result:

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

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

4 Replies

  • hi Syndicate_Admin 

    Supposing you have two columns in sales table: date and amt.
    try to create a measure like:
     
    LowestDay =
    VAR _lowestsales = 
    CALCULATE(MIN(TableName[amt]), ALL(TableName))
    RETURN
    MINX(
        FILTER(
            TableName,
            TableName[amt] = _lowestsales
        ),
        TableName[Date]
    )
  • Thennarasu_R's avatar
    Thennarasu_R
    Icon for Responsive Resident rankResponsive Resident

    Hi
    Syndicate_Admin 
    Do this Measure . you will get your output
    First thing Creare one Min Sales
    1.Min Sales=min (Sales Colunm)
    and then use this formula


    Thanks ,
    Thennarasu



  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, Syndicate_Admin 

     

    If it's more than a year, you can try the following.

    Measure = 
    VAR _minsales =
        CALCULATE ( MIN ( 'Table'[Sales] ), ALLEXCEPT ( 'Date', 'Date'[Year] ) )
    RETURN
        CALCULATE (
            MAX ( 'Table'[Date] ),
            FILTER ( ALL ( 'Table' ), [Sales] = _minsales ),
            FILTER ( ALL ( 'Date' ), [Year] = SELECTEDVALUE ( 'Date'[Year] ) )
        )

    Result:

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

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

  • Thank you very much for the help.

    Actually all the formulas worked.

    I keep the last one, because by modifying I could also determine the day of greatest sale. Thank you