Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DAX counting statuses at certain date

Hi all,   I am beginning to get my head around the basics of DAX but I have a problem that has me stumped. I am working with student applications and need to create a measure that enables me to fi...
  • v-juanli-msft's avatar
    7 years ago

    Hi Anonymous

    Change the relationships as below

     

    create measures in "App_main" table

    max_log_id = CALCULATE(MAX(App_status_log[log_id]),FILTER(ALLSELECTED(App_main),[application_id]=MAX([application_id])))
    
    lastest_status = CALCULATE(MAX(App_status_log[app_status]),FILTER(ALLEXCEPT(App_main,App_main[application_id]),[max_log_id]=MAX(App_status_log[log_id])))
    
    min_date = MIN('calendar'[Date])
    
    max_date = MAX('calendar'[Date])
    
    flag = IF(MAX([date_first_applied])<=[max_date]&&MAX([date_first_applied])>=[min_date],1,0)

     

     

    Add [flag] in the Visual Level Filter, set "show items when value is 1"

     

    Best Regards

    Maggie