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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors