Forum Discussion

clairethnguyen's avatar
clairethnguyen
Frequent Visitor
7 years ago
Solved

Year over year comparison

Hello,   I have a data set like this: Year Program name Has curriculum map use of results 2014 A yes yes 2014 B yes yes 2014 C no yes 2014 D no yes 2014 E yes y...
  • v-piga-msft's avatar
    v-piga-msft
    7 years ago

    Hi clairethnguyen,

     

    For your desired output, it seems that you want to get the output like this.

     

     

    If you want to get the output above, please follow the steps below.

     

    1. Unpivot Has curriculum map and use of results columns in Query Editor.

    2. Create the measures below.

    yes = CALCULATE(COUNTROWS('Table2'),FILTER('Table2','Table2'[Value]="yes"))
    
    totalrows for each year = CALCULATE(COUNT(Table2[Program name]),ALLEXCEPT(Table2,Table2[Year]))
    
    percent = [yes]/ [totalrows for each year]

    3. Create the bar chart.

     

    More details, you could refer to the attachment.

     

    Best Regards,

    Cherry