Skip to main content

Hello experts,

 

My source data is somewhat as following

 

BUYearGLAmount12016511200100120175112002001201851120030012019511200400120195223001000220164110011000002201741100141000022018411001500002201941100287421

 

What I want tableau to do is to be able to generate last 2 year's corresponding value in respect to the selected Year value in filter.

For example, when user selects Year=2018

Calculation in respect to value selected in filter

For example, when user selects Year=2019

pastedImage_1.png

 

This is currently doable in Power BI. Is tableau capable of returning the same view?

4 answers
  1. Sep 9, 2019, 4:29 PM

    Sure. You can build a view like this for starters.

    Sure. You can build a view like this for starters.Then create a parameter like this:Then a calculated field: Keep Year// Want to keep current year (based on parameter) and previous 2.

    Then create a parameter like this:

    pastedImage_3.png

    Then a calculated field:

     

    Keep Year

    // Want to keep current year (based on parameter) and previous 2.

    IF [Year]>=[Year Selected]-2 and [Year]<=[Year Selected] THEN

        "Include"

    ELSE

        "Exclude"

    END

     

    Then filter on that value, only keeping "Include" values.

    pastedImage_5.png

    See attached.

0/9000