Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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...
  • MFelix's avatar
    6 years ago
    Hi ,

    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.