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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
jostnachs
Helper IV
Helper IV

count by buckets

Hi all....

 

I have a requirement where i have to show count of clients grouped by commission buckets.

But as per below screenshots there is only 1 client but he is falling under different buckets hence showing client count as 3. but it should be 1. how do i do that?

jostnachs_0-1739504844892.png

formula for commission_buckets 

jostnachs_3-1739505274023.png

 

# clients 

jostnachs_2-1739505240167.png

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @jostnachs 

Apply your conditional column to the total estimated compensasion by client and not to the individual commission rows.

Commission_Bucket =
VAR ClientCommission =
    CALCULATE (
        SUM ( V_DimPolicy[EstimatedCommission] ),
        ALLEXCEPT ( V_DimPolicy, V_DimPolicy[ClientID] )
    )
RETURN
    SWITCH (
        TRUE (),
        ClientCommission >= 0
            && ClientCommission <= 5000, "<5K",
        ClientCommission > 5000
            && ClientCommission <= 10000, "5K-10K",
        ClientCommission > 10000
            && ClientCommission <= 30000, "10K-30K",
        ClientCommission > 30000
            && ClientCommission <= 50000, "30K-50K",
        ClientCommission > 50000
            && ClientCommission <= 100000, "50-100K",
        ClientCommission > 100000, "100K+",
        ISBLANK ( ClientCommission ), "Blank",
        "Out of Range" -- Optional to catch any edge cases
    )

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @jostnachs 

Apply your conditional column to the total estimated compensasion by client and not to the individual commission rows.

Commission_Bucket =
VAR ClientCommission =
    CALCULATE (
        SUM ( V_DimPolicy[EstimatedCommission] ),
        ALLEXCEPT ( V_DimPolicy, V_DimPolicy[ClientID] )
    )
RETURN
    SWITCH (
        TRUE (),
        ClientCommission >= 0
            && ClientCommission <= 5000, "<5K",
        ClientCommission > 5000
            && ClientCommission <= 10000, "5K-10K",
        ClientCommission > 10000
            && ClientCommission <= 30000, "10K-30K",
        ClientCommission > 30000
            && ClientCommission <= 50000, "30K-50K",
        ClientCommission > 50000
            && ClientCommission <= 100000, "50-100K",
        ClientCommission > 100000, "100K+",
        ISBLANK ( ClientCommission ), "Blank",
        "Out of Range" -- Optional to catch any edge cases
    )

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Perfect! Worked like a charm... thanks a lot @danextian 

Ritaf1983
Super User
Super User

Hi @jostnachs 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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