Forum Discussion

Agent47's avatar
Agent47
Icon for Helper I rankHelper I
1 year ago
Solved

Can slicers change fields based upon another slicer ?

 
WHen FY calendar is selected as Apr-Mar , then year shows FY , When selected as Jan-Dec , shows as year.

    Some tableau calculated functions are as follows 
case [Calendar Selection]
when 'Calendar' then 'Jan - Dec'
when 'Fiscal' then 'Apr - Mar'
END

Can this be replicated in power BI ?
Thanks for your help 

lbendlin  egpjavier , danextian 

 

  • Create a field parameter with year and financial year as the fields, and use this as the slicer. You'll also need to use it in any visuals you want to be affected.

    Create a measure like

    Year selector is visible =
    VAR ChosenYearType =
        SELECTEDVALUE ( 'Select FY Calendar'[Value] )
    VAR CurrentFieldParam =
        SELECTEDVALUE ( 'Year FY Param'[Ordinal] ) // Have to use ordinal here
    VAR Result =
        SWITCH (
            TRUE (),
            ChosenYearType = "Jan - Dec"
                && CurrentFieldParam = 0, // Year
            1,
            ChosenYearType = "Apr - Mar"
                && CurrentFieldParam = 0, // FY
            1
        )
    RETURN
        Result
    

    Add this measure as a filter to the field parameter slicer, set to show only when the value is 1.

4 Replies

  • Create a field parameter with year and financial year as the fields, and use this as the slicer. You'll also need to use it in any visuals you want to be affected.

    Create a measure like

    Year selector is visible =
    VAR ChosenYearType =
        SELECTEDVALUE ( 'Select FY Calendar'[Value] )
    VAR CurrentFieldParam =
        SELECTEDVALUE ( 'Year FY Param'[Ordinal] ) // Have to use ordinal here
    VAR Result =
        SWITCH (
            TRUE (),
            ChosenYearType = "Jan - Dec"
                && CurrentFieldParam = 0, // Year
            1,
            ChosenYearType = "Apr - Mar"
                && CurrentFieldParam = 0, // FY
            1
        )
    RETURN
        Result
    

    Add this measure as a filter to the field parameter slicer, set to show only when the value is 1.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Agent47,

     

    Thanks johnt75 for Addressing the issue.

     

    we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
    If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,
    Vinay Pabbu

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi @Agent47,

       

      we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
      If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

       

      Regards,
      Vinay Pabbu

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi @Agent47,

         

        we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
        If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

         

        Regards,
        Vinay Pabbu