Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Parameter in Calculated column

Hi,   I have an excel formula that uses two parameter dates that are inputted by the user in my spreadsheet.   E.g. IF(AND(ParameterStartDate<[@[Start Date]],ParameterEndDate>[@[End Date]]).    ...
  • v-alq-msft's avatar
    6 years ago

    Hi, Anonymous 

     

    A measure will reflect the selection of the slicer in time, and the column is refreshed only after loading and clicking the Refresh button, and can't be interacted with other visual. I created data to reproduce your scenario. The pbix file is attached in the end.

     

    Table:

     

    Calendar(a calculated table):

    Calendar = CALENDARAUTO()

     

    There is no relationship between two tables. You create a meaure like below.

    Result = 
    var _parameterstartdate = 
    CALCULATE(
        MIN('Calendar'[Date]),
        ALLSELECTED('Calendar')
    )
    var _parameterenddate = 
    CALCULATE(
        MAX('Calendar'[Date]),
        ALLSELECTED('Calendar')
    )
    return
    IF(
        _parameterstartdate<SELECTEDVALUE('Table'[StartDate])&&
        _parameterenddate>SELECTEDVALUE('Table'[EndDate]),
        "Yes","No"
    )

     

    Result:

     

    Best Regards

    Allan

     

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