Forum Discussion
Anonymous
6 years agoNot applicable
Compare Weekly History by user selected weeks
Hi PBI Community, I have a SQL table that is archived weekly and dumped into a table. The setup is roughly like this: ID (with duplicates) Stage Value Associated Date Timestamp of back...
- 6 years agoHi ,
You can make a slicer based on a table of weeks and the selection on one slicer with two selection and then make the measure something similar to this:
VALUE1 =
CALCULATE (
SUM ( Table[Column] );
FILTER ( ALL ( Table[week] ); Table[week] = MIN ( weekstable[week] ) )
)
VALUE2 =
CALCULATE (
SUM ( Table[Column] );
FILTER ( ALL ( Table[week] ); Table[week] = MAX ( weekstable[week] ) )
)
Be aware that if people select more than 1 week it will return the difference between the max and min week so you can add a meaure to say that people should only choose two weeks.
MFelix
Super User
6 years agoHi ,
You can make a slicer based on a table of weeks and the selection on one slicer with two selection and then make the measure something similar to this:
VALUE1 =
CALCULATE (
SUM ( Table[Column] );
FILTER ( ALL ( Table[week] ); Table[week] = MIN ( weekstable[week] ) )
)
VALUE2 =
CALCULATE (
SUM ( Table[Column] );
FILTER ( ALL ( Table[week] ); Table[week] = MAX ( weekstable[week] ) )
)
Be aware that if people select more than 1 week it will return the difference between the max and min week so you can add a meaure to say that people should only choose two weeks.
You can make a slicer based on a table of weeks and the selection on one slicer with two selection and then make the measure something similar to this:
VALUE1 =
CALCULATE (
SUM ( Table[Column] );
FILTER ( ALL ( Table[week] ); Table[week] = MIN ( weekstable[week] ) )
)
VALUE2 =
CALCULATE (
SUM ( Table[Column] );
FILTER ( ALL ( Table[week] ); Table[week] = MAX ( weekstable[week] ) )
)
Be aware that if people select more than 1 week it will return the difference between the max and min week so you can add a meaure to say that people should only choose two weeks.
Anonymous
6 years agoNot applicable
Brilliant and simple. Thanks.