Forum Discussion

Ski034's avatar
Ski034
Regular Visitor
1 year ago
Solved

Creating Threshold Buckets for Sum Total while using Date Slicer that can be used in Bar Chart

I have donation transactions that are grouped by an id with relationships built between transaction table, date table, id table.  I want to find the sum of the transaction total that is dynamic to a date slicer. Standalone I have accomplished this:

 

 

Total Giving = 
CALCULATE(
    SUM('Financial Transactions'[Amount]),
    ALLSELECTED('Date')
)

 

 

 Works in isolation and then created a table with my category thresholds (example):

 

 

Giving Categories = 
DATATABLE(
    "Min", INTEGER, 
    "Max", INTEGER, 
    "Category", STRING,
    {
        {0, 500, "0 - 500"},
        {501, 1000, "501 - 1000"},
        {1001, 5000, "1001 - 5000"},
        {5001, 9999999, "5001+"}
    }
)

 

 

I have had some success in making this work within a table, but can't within bar chart. Here is an example of a Giving Category Measure that worked within table, but failed in bar chart due to Lookup:

Donation Category = 
VAR TotalAmount = [Total Donations]
RETURN
LOOKUPVALUE(
    CategoryTable[Category Name], 
    CategoryTable[MinAmount], 
    MAXX(
        FILTER(CategoryTable, 
            TotalAmount >= CategoryTable[MinAmount] &&
            TotalAmount <= CategoryTable[MaxAmount]
        ),
        CategoryTable[MinAmount]
    )
)


Issue: I either create a measure to pull the Total Giving and assign a category via table or within the measure itself and run into these issues:

  • Can't add Measure to Bar Chart due to it not having the categorization
  • Calculated column isnt dynamic to the date filter

 

Find myself going in cirlces. End goal is to have a bar chart with total (Count of Givingid's) on Y axis and Categories (0-500,501-1000, etc) as the x-axis that is dynamic to changing date range. 

2 Replies

    • Ski034's avatar
      Ski034
      Regular Visitor

      This was really helpful and did get me a lot closer to what I am trying to accomplish :)! Thank you!