Forum Discussion

vic3197's avatar
vic3197
Frequent Visitor
3 years ago
Solved

Show subsequent data after selecting a filter

Hi community!

 

I need your help to solve a small problem. In my graph I have to sample the last twelve weeks of data, but I also have to make it so that if I select a specific week with a filter, this week shows me its data and the 11 data prior to this.

 

The problem occurs when I select the filter for another week, since it only shows me the data for that week and no week prior to the one selected.

 

Thanks for your support!

  • Hi, vic3197 

     

    You can try the following methods.
    Sample data:

    Make a new filter table. Two tables do not establish a relationship directly.
    Table:

    Slicer = VALUES('Table'[Week])

    Measure:

    Measure = 
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( Slicer[Week] ) = BLANK (), 1,
        SELECTEDVALUE ( 'Table'[Week] ) <= SELECTEDVALUE ( Slicer[Week] )
            && SELECTEDVALUE ( 'Table'[Week] )
                > SELECTEDVALUE ( Slicer[Week] ) - 12, 1,
        0
    )

    Put Measure into the view and set it equal to 1.

    Show all when slicers are not selected. When the slicer is selected, it displays the data for the selected week and the previous eleven weeks.

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, vic3197 

     

    You can try the following methods.
    Sample data:

    Make a new filter table. Two tables do not establish a relationship directly.
    Table:

    Slicer = VALUES('Table'[Week])

    Measure:

    Measure = 
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( Slicer[Week] ) = BLANK (), 1,
        SELECTEDVALUE ( 'Table'[Week] ) <= SELECTEDVALUE ( Slicer[Week] )
            && SELECTEDVALUE ( 'Table'[Week] )
                > SELECTEDVALUE ( Slicer[Week] ) - 12, 1,
        0
    )

    Put Measure into the view and set it equal to 1.

    Show all when slicers are not selected. When the slicer is selected, it displays the data for the selected week and the previous eleven weeks.

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.