Forum Discussion

robofski's avatar
robofski
Resolver II
5 years ago
Solved

Survey Data changes over time

Hi folks, hoping I can explain what I'm trying to do clearly enough that someone might be able to help!   I have survey data where respondants answer several questions with the same answers (coming...
  • BA_Pete's avatar
    BA_Pete
    5 years ago

    Hi robofski ,

     

    Based on your example data, I get the following output:

     

    I suspect that in your real data the [Date Received] field isn't always the first of the month, right?

    If so, then you can adjust the measure as follows:

    _responsePercent =
    VAR __totalResponses =
    CALCULATE(
      COUNT(yourTable[Answer]),
      ALLEXCEPT(yourTable, yourTable[yourMonthField]) //Use month (or better, month/year) field instead of [Date Received]
    )
    VAR __selectedResponses =
    COUNT(yourTable[Answer])
    RETURN
    DIVIDE( __selectedResponses, __totalResponses , 0)

     

    As an aside: I notice that your output is only using months, not month/year. I would recommend updating the measure to using month/year in case you report over many years, in which case, the same months in different years wll be aggregated together.

     

    Pete