Forum Discussion

drwinny's avatar
drwinny
Helper I
6 years ago
Solved

DAX help

Hi All,   I am new to DAX and I have a table with losts of different surveys and peoples answers to the surveys.   1) I need to know if a customer has completed all of the questions (in this exam...
  • kentyler's avatar
    6 years ago

    The DAX will be much easier if you break your one big table down into a star schema (I can help you break it down if you need) 
    My next step was to add a calculated column to the Client Survey records to determine if an individual question had been answered.
    Here's the DAX for that column: 

    Is_Answered = if(len(ClientSurvey[answer])=0,0,1)
     
    Once I have that I can create a visual

    The visual uses 2 measures, one that counts the number of questions for each survey, the other that counts the number of answers:
    Number Answers = calculate(countrows(clientsurvey),ClientSurvey[Is_Answered] = 1)
    Number Questions = countrows(ClientSurvey)
    Then I can subtract them to see if the survey is complete
    survey complete = AND([Number Questions]>0,[Number Questions] = [Number Answers])
    or to see if it was partial
    survey partial = AND([Number Questions]>0, [Number Answers]>0)
     
    that's a lot all at once. i'd be glad to do a screen share and walk through it with you. send me your email and i'll send you a zoom invitation. I'll be free in about an hour and a half
     
    I'm a personal Power BI trainer  every time I answer a question I learn something