Forum Discussion

tomperro's avatar
tomperro
Helper V
2 years ago
Solved

Best Practice for Storing Commonly Used Variables / Parameters

Is there a way to store commonly used variables in a table or other way? For eample, I am using a measure to determine which employees are considered new hires. Currently, I am looking for anyone t...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi tomperro ,

    I create a new table.

    Table = DATATABLE("NewHireThreshold",INTEGER,{{12}})

    Then I create another table as you mentioned.

    There is a  measure and here is the DAX code.

    IsNewHire =
    IF (
        DATEDIFF ( TODAY (), MAX ( 'Employee'[HireDate] ), MONTH )
            >= MAX ( 'Table'[NewHireThreshold] ),
        "Yes",
        "No"
    )

     

     

     

    Best Regards

    Yilong Zhou

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