Forum Discussion

Cristian's avatar
Cristian
Frequent Visitor
7 years ago
Solved

KPI from survey responses - transform data to make it suitable for KPI visual

Hi All,

I would like to ask if you can recommend a way to manipulate the data below in Power BI so it is suitable for a KPI visual:

DateAnswer
01-Jan-18Agree
01-Jan-18Agree
01-Jan-18Disagree
01-Jan-18Neutral
01-Jan-18null
01-Feb-18Agree
01-Feb-18Agree
01-Feb-18Agree
01-Feb-18Disagree
01-Feb-18Neutral

 

I would like to know how the answers changed month by month. I.e. in February 60% "Agreed" (Indicator) vs January when only 40% "Agreed" (Goal).

Many thanks,
Cristian

  • Hi Cristian,

    Based on my test, you could refer to below steps:

    Create below measures:

    Goal = CALCULATE(COUNT(Table1[Answer]),FILTER(ALL(Table1),'Table1'[Answer]="Agree"&&MONTH('Table1'[Date])=1))/CALCULATE(COUNT(Table1[Date]),FILTER(ALL(Table1),'Table1'[Date]=MAX('Table1'[Date])))
    Indicator = CALCULATE(COUNT(Table1[Answer]),FILTER(ALL(Table1),'Table1'[Answer]="Agree"&&MONTH('Table1'[Date])=2))/CALCULATE(COUNT(Table1[Date]),FILTER(ALL(Table1),'Table1'[Date]=MAX('Table1'[Date])))
    Result:
    You could also download the pbix file to have a view.
     
    Regards,
    Daniel He

2 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi Cristian,

    Based on my test, you could refer to below steps:

    Create below measures:

    Goal = CALCULATE(COUNT(Table1[Answer]),FILTER(ALL(Table1),'Table1'[Answer]="Agree"&&MONTH('Table1'[Date])=1))/CALCULATE(COUNT(Table1[Date]),FILTER(ALL(Table1),'Table1'[Date]=MAX('Table1'[Date])))
    Indicator = CALCULATE(COUNT(Table1[Answer]),FILTER(ALL(Table1),'Table1'[Answer]="Agree"&&MONTH('Table1'[Date])=2))/CALCULATE(COUNT(Table1[Date]),FILTER(ALL(Table1),'Table1'[Date]=MAX('Table1'[Date])))
    Result:
    You could also download the pbix file to have a view.
     
    Regards,
    Daniel He
    • Cristian's avatar
      Cristian
      Frequent Visitor

      Hi v-danhe-msft,

      Many thanks for the reply. This is the sort of thing I'm after.

      Cheers,
      Cristian