How to calculate Subtotal & total when unit column is filtered for Percentage or Number

In my report how to calculate subtotal and total based on filter. If my filter is number then I need to do subtotal and total. But if my filter is percentage then I dont want to show Subtotal and total.

Hello @Meena1 Hope this message finds you well

My Suggestion is: To control the display of subtotals and totals in qs based on filters, you might consider using parameters along with calculated fields. Here is an approach you can follow:

  1. Create a Parameter:

    • In the QuickSight analysis pane, navigate to the parameters section.
    • Create a new parameter named FilterTypeParam with possible values such as ‘Number’ and ‘Percentage’.
  2. Create a Calculated Field with the Parameter:

    • Use the parameter to create a calculated field that controls the display logic.
    ifelse( {FilterTypeParam} = 'Number', 'ShowTotals', {FilterTypeParam} = 'Percentage', 'HideTotals', 'ShowTotals' )
    
  3. Configure the Visualisation:

    • In your visualisation, go to the subtotals and totals section.
    • Use the calculated field to apply a display rule. For instance, if the calculated field returns ‘ShowTotals’, configure it to show the subtotals and totals. Otherwise, hide them.

This way, you can use a parameter to dynamically control the display of subtotals and totals based on the selected filter type.

Please tell me if its help you

Thank you for the suggestion, as you have mentioned above Using Rules for the display Visual help me to Hide Subtotal and Total for Percentage.