Forum Discussion
Line and Stacked Colum - How to Show Average on Line?
- 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...
What 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.
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...
- cw9002 years ago
Helper I
Hmmm. ALLEXCEPT looks useful but I'm struggling to work out the implementation.
The following measure just gives me the same average on each date.
New Avg v3 =CALCULATE(AVERAGE (CourseData[Total]),CourseData[Event_Type]="Login",ALLEXCEPT(CourseData, CourseData[Student_Course_Name])) - _AAndrade2 years ago
Resident Rockstar
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...
- cw9002 years ago
Helper I
That was it 🙂
Thank you.
- _AAndrade2 years ago
Resident Rockstar
Great. You're welcome.