Forum Discussion
FIRSTDATE and LASTDATE
Hello Xiaoxin Sheng,
Thanks for your fast response.
I took a look at your file, but I'm still not getting the correct averages.
Maybe I didn't explain it well enough.
If I use the date slicer to filter my averages for only 2017, I get the output below:
The problem is that a date that is earlier than the selected range is used within the measures.
When I filter the rows in the query editor to only dates in 2017 I get the following output:
For the same ID the date now is within 2017, which is what I want.
Does this explain my problem more clearly?
Kind regards
HI SNV,
I can't got your logic.
In your visual, you use the 'group' as the axis, so this graph shows summarized result by group column. When you filter on matrix by specific ID, then graph will change.
BTW, if you want to use show the correspond result, you need to modify your chart and use 'ID' as the axis.
Regards,
Xiaoxin Sheng
- SNV8 years ago
Advocate I
Hello Xiaoxin Sheng,
The way I want it to work is as follows:
- With the slicer a date range is selected. For example, 01-01-2017 through 31-12-2017.
- I now want the average per group from the scores with a FIRSTDATE within this date range and the average per group from the scores with a LASTDATE within this date range.
- If an ID has multiple scores on the same FIRSTDATE or LASTDATE that should first be averaged before the group average is calculated.
The problem is that while a date range is selected with the slicer, for some ID's a date is selected which falls out of this range. As seen in my previous post, a date is shown from 2015. This is not correct, and the average is miscalculated because of that.
Is this more clear?
Kind regards.