Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

selecting specific value from a table (with condition)

Hello experts,    I'm tring to select a specific value from a table in order to use it in other calculations - numerical type. The value i'm looking for is remaining_working_days = 9.5 (rec_month ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi!

    Actually it wasn't the issue in the end i solved it by the following query:

     

    Remaining_Working_Days =
    var rec_month = SELECTEDVALUE(DIM_BO_WDAYS[REC_MONTH])
    var month_from_dim_date = SELECTEDVALUE(Dim_Dates[Month])
    var current_year = SELECTEDVALUE(Dim_Dates[Year])
    var rec_year = SELECTEDVALUE(DIM_BO_WDAYS[REC_YEAR])
    var filter_year = IF(rec_year=current_year,rec_year)
    var clc = CALCULATE(SELECTEDVALUE(DIM_BO_WDAYS[Remaining_Working_Days]),FILTER(ALL(DIM_BO_WDAYS[REC_MONTH], DIM_BO_WDAYS[REC_YEAR]), DIM_BO_WDAYS[REC_YEAR]=current_year && DIM_BO_WDAYS[REC_MONTH]=month_from_dim_date))
    return clc
     
    But still thanks for responding:)