Forum Discussion
Data changing when adding legend
your running total calculation is not correct. You need to move the MAX() part outside of the CALCULATE() part (by using a variable). Pseudo code:
Running Total =
var m = MAX([Date])
return calculate(distinctcount([NewLogin]),[Date]<=m)
- Chris13004 years agoHelper II
Did not work. the result is the same even with MAX() outside the calculate or inside.
- lbendlin4 years agoSuper User
Please provide sanitized sample data that fully covers your issue.
- Chris13004 years agoHelper II
I have given an example dataset shown below.
My goal is to make 2 charts. The first Chart would be a column chart. X-axis would have the [week_num_date] and the Y-axis would have the Cumulative Total (aka Running Total of distinct login), which I created a measure.
Running Total = CALCULATE ( DISTINCTCOUNT('Table2'[NewLogin]), 'Table2'[Week_Num_Date]<= MAX('Table2'[Week_Num_Date]))The next chart would also be a similar column chart, but to show a legend of [EMP_DEPT_NM]. When I add this legend the overall distinct count changes and unable to show similar values as Chart 1.
NewLogin EMP_DEPT_NM Week_Num_Date B4714 Branch Operations 5/22/21 B7788 Branch Operations 5/22/21 C3553 Lending 5/22/21 C1254 Lending 5/22/21 A9948 President/CEO''s Office 5/29/21 B3683 President/CEO''s Office 5/29/21 C3553 Lending 5/29/21 C2222 Finance 6/5/21 C1296 Finance 6/5/21 B6326 Information Services 6/5/21 A9865 Branch Operations 6/5/21 B7788 Branch Operations 6/5/21