Forum Discussion
cw900
Helper I
2 years agoLine and Stacked Colum - How to Show Average on Line?
I want to show a student's login activity per day (Event_Type = "Login") as columns and I want to show the course average for the course that the student is on as the line on the same graph. Here...
- 2 years ago
In the Allexcepted put the column date that your are using in the charte.
Allexcepted will remove all filter on that table except on the column you mention, so I think it Could solve your problem.
Try...
_AAndrade
Resident Rockstar
2 years agoPlease take a look it this is what you're looking for:
My AverageCourse measure it this:
AverageCourse =
IF(
NOT(ISBLANK([Count of Logins])),
CALCULATE(
[SimpleAvg],
FILTER(
ALL(T_Logins),
T_Logins[Event_Type]="Login" && T_Logins[Student_Course_Name] IN VALUES(T_Logins[Student_Course_Name])
)
)
)cw900
Helper I
2 years agoWhat is
[SimpleAvg]
?
Also, that doesn't look right because the average value doesn't change each day. I need average value for the course on each day, so it will change every day.
- _AAndrade2 years ago
Resident Rockstar
cw900,
See if this solve your problem:
Measures:SimpleAvg = AVERAGE (T_Logins[Total]) New Avg = IF( NOT(ISBLANK([Count of Logins])), CALCULATE( [SimpleAvg], REMOVEFILTERS(T_Logins[Student]), T_Logins[Event_Type]="Login" ) )- cw9002 years ago
Helper I
Ok that is much closer. I changed the measure to this:
New Avg v2 =CALCULATE(AVERAGE (CourseData[Total]),CourseData[Event_Type]="Login",REMOVEFILTERS(CourseData[Student]))This works in the example here but when I apply this to my real data it doesn't work. I think because my real table contains many other fields other than Student_Course_Name.Is there any way in that measure to say only calculate the average based on Student_Course_Name?- _AAndrade2 years ago
Resident Rockstar
Try something using Allexcepted.
DAX is all about context and for that reason is important to have the right example.
In my example is working fine on my side...