Forum Discussion
Compare data to same previous period
That's not what I'm looking for.
If I do that and I change the date slicer to cover a month, it's going to compare a month to only three days before the selected start date. I'm looking for a solution that will automatically cover the same previous period every time I change the data slicer. So when I set it to a month, I want an automatic comparison to the month before. If I set it to 15 days, I want an automatic comparison to the 15 days before that. If I set the date slicer to 188 random days, I want an automatic comparison to the 188 days preceedingly.
(But yes, good thinking it should be with the KPI visual, thanks).
Then change the second measure a little bit.
3 days before selectd period =
VAR minSelectedDate =
MIN ( 'Table'[date] )
VAR maxSelectedDate =
MAX ( 'Table'[date] )
VAR periodDays =
INT ( maxSelectedDate - minSelectedDate )
VAR startDate = minSelectedDate - periodDays
RETURN
CALCULATE (
SUM ( 'Table'[value] ),
FILTER (
ALL ( 'Table' ),
'Table'[date] >= startDate
&& 'Table'[date] < minSelectedDate
)
)- Paulien19899 years ago
Advocate II
Hmm it looks good, but it's not working. I want to compare the number of goal completions between the selected period and the previous period. When I use your measure, it looks like this:
- Eric_Zhang9 years ago
Microsoft Employee
What if put those two measures to split card visuals? By the way, could you share a pbix file with sample data?
- Leonardoup113 years agoNew Member
Were you able to solve this?
I would like to do the same thing you are trying to do here.