Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

SUM values slicer in Between option

I need to get on between slicer based on SUM Values

 

between slicer will work individual line items only

if we move between slicer like greater than 40 it will show in the table only banana value = 44

as we have apple SUM Value = 43 and banana = 44 both should show in the table, how to fix this.

 

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-slicer-numeric-range

 

example table

name     amount

Apple   10

Orange 22

Apple  33

banana  44

  • Hello,
    you can use this calculated column:

    Column =
    SUMX(FILTER('Table',[name]=EARLIER('Table'[name])),[amount])
    and use it for slicer
    result could be like this:

    we are getting a also because total value is 4

    if this helps, please mark as solution

15 Replies

  • Anonymous For this, create a measure like Total Amount = SUM('Table'[Amount]) and use it in the slicer. The slicer will now filter based on the total sum, showing both Apple and Banana if their combined value meets the condition.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I understood as we need between option to see user

  • Hi Anonymous ,

     

    In Power BI, a standard "Between" slicer works on individual row values, not on aggregated values like the sum of amounts per name. In your example, the slicer on amount would only include rows where the individual amount is greater than 40, which is why only Banana (44) shows up, and Apple (10 and 33) gets excluded—even though its total is 43. To fix this and apply the slicer based on the sum of amounts per name, you’ll need to create a summary table that groups data by name and calculates the total amount. Use this table as the basis for your slicer, and then filter the original table accordingly.

    First, create a summarized table using DAX like this:

    NameSummary =
    SUMMARIZE(
        'YourTable',
        'YourTable'[name],
        "TotalAmount", SUM('YourTable'[amount])
    )
    

    This gives you a new table with unique names and their total amounts. You can then create a slicer on the TotalAmount column from the NameSummary table. Since slicers and visual filters don’t automatically filter the original table by aggregation, you need a measure to bridge the logic between the two.

    Define a DAX measure like this:

    ShowNameFlag =
    VAR SelectedMin = MIN('NameSummary'[TotalAmount])
    VAR SelectedMax = MAX('NameSummary'[TotalAmount])
    VAR ThisName = SELECTEDVALUE('YourTable'[name])
    VAR ThisTotal =
        CALCULATE(
            SUM('YourTable'[amount]),
            ALLEXCEPT('YourTable', 'YourTable'[name])
        )
    RETURN
    IF(
        ThisTotal >= SelectedMin &&
        ThisTotal <= SelectedMax,
        1,
        0
    )
    

    Apply this measure as a visual-level filter in your table where ShowNameFlag = 1. This way, the table visual will only show names whose total amount falls within the selected range in the slicer—even though the original table still contains individual line items. This workaround bypasses the slicer's limitation and gives you the correct aggregated filtering behavior.

     

    Best regards,

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I created formula suggested DAX Function as not getting result the same , do you have sample dataset created similar to this

    • Anonymous's avatar
      Anonymous
      Not applicable

      I'm not getting the same result and Do you have same data so i can refer it

  • Create a calculated table or measure to filter based on SUM per name, not row-level values.

    Create a measure to calculate the sum of amount by name:

    TotalAmountByName = CALCULATE(SUM('Table'[amount]), ALLEXCEPT('Table', 'Table'[name]))

    Create a new disconnected table for your slicer:

    SlicerTable = GENERATESERIES(0, 100, 1)
    This gives values 0 to 100 for use in the slicer.

    Create a measure to capture selected value from slicer:

    SelectedMinAmount = SELECTEDVALUE(SlicerTable[Value], 0)

    Create a measure for filtering visual rows:

    ShowName = VAR TotalAmt = CALCULATE(SUM('Table'[amount]), ALLEXCEPT('Table', 'Table'[name])) RETURN IF(TotalAmt >= [SelectedMinAmount], 1, 0)

    Apply this as a visual-level filter on your table:

    Go to your visual.

    Add the ShowName measure to the Filters pane.

    Set it to show only when value = 1.

     

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      I created formula suggested DAX Function as not getting result the same , do you have sample dataset created similar to this.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi - I'm not getting the same result and Do you have same data so i can refer it

  • Hello,
    you can use this calculated column:

    Column =
    SUMX(FILTER('Table',[name]=EARLIER('Table'[name])),[amount])
    and use it for slicer
    result could be like this:

    we are getting a also because total value is 4

    if this helps, please mark as solution

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

    Hi Anonymous ,
    Just wanted to check if you had the opportunity to review the suggestions provided?
    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

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

    Hi @RajK2 ,
    Just wanted to check if you had the opportunity to review the suggestions provided?
    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

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

    Hi Anonymous ,
    Just wanted to check if you had the opportunity to review the suggestions provided?
    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

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

    Hi Anonymous ,
    I have tried to reproduced the scenario using the measure provided by Vijay_Chethan  and was able to get the result.
    Please find the file attcahed.
    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for update!

       

      I've added two columns in the table for Year, Quarter after adding columns I am using filter = year as its not working for Slicer measure for range between, how to fix in slicer measure include in year/quarter.

       

      Slicer = SUMX(FILTER('Table',[name]=EARLIER('Table'[name])),[amount])
       

      Here is table for sample dataset

       

      NameAmountyearquarterslicer
       Apple1020251 
       Apple2520241 
       Apple3520253 
       Orange2220254 
       Apple3320251 
       Banana4420241 
       Orange520254 
       Banana1120252 
       Grape5020253 
       Apple520243 
       Mango2020251 
       Mango2520241 

       

      example :  apple filter 2024 then slicer range should get change = 25 ----- 44 like wise 2025 as not here

       

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

    Hi Anonymous ,
    You can try to use this-
    Slicer Measure =
    CALCULATE(
    SUM('Table'[Amount]),
    ALLEXCEPT('Table', 'Table'[Name], 'Table'[Year], 'Table'[Quarter])
    )
    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You!