Forum Discussion

cmaloyb's avatar
cmaloyb
Icon for Helper II rankHelper II
6 years ago
Solved

Line Graph with Multiple Months and Averages

Hi there,   I am fairly new to Power BI and need help with creating a trend line/line graph from my data.   My first table, Monthly Turn-In Table tracks when students A through G turn in a monthl...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi cmaloyb ,

    Please try to update the formula of measure as below:

    NumberofsubA = VAR a=MAX('Table 1'[Turn-in Date (Month)])
    VAR b=DIVIDE(CALCULATE(DISTINCTCOUNT('Table 1'[Student ID])),
    COUNTBLANK('Table 2'[Program Start Date])+CALCULATE(COUNT('Table 2'[Student ID]),FILTER('Table 2',NOT(ISBLANK('Table 2'[Program Start Date]))&&'Table 2'[Program Start Date]<=a)),0)
    return b

    Here updated the formula of calculating the number of active students:

    1. Calculate the number of program start date which is blank     

    COUNTBLANK('Table 2'[Program Start Date])

    2. Calculate the number of program start data which is less than assignment submit date

    CALCULATE(COUNT('Table 2'[Student ID]),FILTER('Table 2',NOT(ISBLANK('Table 2'[Program Start Date]))&&'Table 2'[Program Start Date]<=a)

    3. Add both to get active student numbers

    Best Regards

    Rena