Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
ergocorp
Helper II
Helper II

How to put suppliers into amount brackets/pots

Hi all I was wondering of the community could help. I have a lot of spend data, but let's simplify it. Let's say I have:

SupplierSpend
a4
b5
c3
d5
a3
e3
c1
b7
f5

 

I've used a simple meaure to add up all the same suppliers, well call that Query1[Sum Up]. What i'm looking to do is count up how many suppliers have spent certain values, and visualise it in a table (or matrix if it comes to that). Let's say it's 0-2, 3-4, 5-6, 7+.

 

Any ideas would be much appreciated.

 

Thanks.

1 ACCEPTED SOLUTION

HI @ergocorp ,

 

There must not be a relationship between this two tables, you just need to add the notation quote to the table name change your measure to:

 

Total Suppliers by tier =
COALESCE (
    COUNTROWS (
        FILTER (
            SUMMARIZE ( 'Query1', 'Query1'[Supplier Name], "@TotalValue", [Sum of Spend] ),
            [@TotalValue] <= MAX ( 'Table'[Max] )
                && [@TotalValue] >= MIN ( 'Table'[Min] )
        )
    ),
    0
)

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

8 REPLIES 8
MFelix
Super User
Super User

Hi  @ergocorp ,

 

You have several options one is to create the tiers based on the groups, rigth click the column you need and add new group:

MFelix_0-1624613222254.png

In this window you can make the groups has you need.

 

Other option is to create a table with the groups you need and a maximum and minimum value similar to this:

 

ID Group Max Min
1 0 -2  2 0
2 3 - 4  4 3
3 5 - 6 6 5
4 7+ 999 7

 

 

Now create the following measure:

Total Suppliers by tier = COUNTROWS(FILTER(ALL('Table'), 'Table'[Spend] <= MAX(Tiers[Max]) && 'Table'[Spend] >= MIN(Tiers[Min])))

 

MFelix_1-1624613731627.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Thanks, I imagine this would work if you have lots of singular data, however I have situations where I have the same supplier. In these instances, the amount would be added up. Taking my original example:

 

a4
b5
c3
d5
a3
e3
c1
b7
f5

 

After the SUM measure would effectively be 

 

a7
b12
c4
d5
  
e3
  
  
f5

 

I would then need to put these into pots/tiers. As that SUM is generated from a measure, it's not the data i need. To overcoe this, would that SUM function be some where in the DAX code?

 

On a side note, i'm in the dark around new tables. I can see the 'new table' facility, it opens a DAX line for table =

 

If that is the route I end up with, will I be abl to find how to do it with a simple google search?

HI @ergocorp 

 

Redo your measure to the following code:

Total Suppliers by tier =
COALESCE (
    COUNTROWS (
        FILTER (
            SUMMARIZE ( 'Table', 'Table'[Supplier], "@TotalValue", SUM ( 'Table'[Spend] ) ),
            [@TotalValue] <= MAX ( Tiers[Max] )
                && [@TotalValue] >= MIN ( Tiers[Min] )
        )
    ),
    0
)

 

MFelix_0-1624628173142.png

 

Replace the SUM(Table[Spend]) by your measure name.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





I think we are almost there, Miguel. Thank you for your responses and patience.

 

ergocorp_0-1624631185432.png

I'm getting that message. Here is my table:

ergocorp_1-1624631352353.png

Any idea where I'm going wrong with the syntax?

Hi @ergocorp ,

 

Does the table with the maximun and minimum is called Table?

 

You need to write the Table in the measure has 'Table' that is the error you are getting.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Hi @MFelix ,

 

It is indeed called Table:

ergocorp_0-1624864239757.png

 

I just had a thought, could it be that there are no defined relationships between Query1 (where the measure is) and Table?

 

HI @ergocorp ,

 

There must not be a relationship between this two tables, you just need to add the notation quote to the table name change your measure to:

 

Total Suppliers by tier =
COALESCE (
    COUNTROWS (
        FILTER (
            SUMMARIZE ( 'Query1', 'Query1'[Supplier Name], "@TotalValue", [Sum of Spend] ),
            [@TotalValue] <= MAX ( 'Table'[Max] )
                && [@TotalValue] >= MIN ( 'Table'[Min] )
        )
    ),
    0
)

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Excellent, thank you @MFelix 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.