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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to group in different custom bins?

I have the below data about Revenue:

ovonel_0-1633330151786.png

 

I need to combine 2 measures in a bar chart...

 

-Number of clients in each group.

-Group in different bins based on revenue group ie (0-1000) (1000-2000) (2000-3000) etc...

 

For the first measure I easily did it with a measure for each group:

CALCULATE (  DISTINCTCOUNT('Fact'[Key_Client]),  FILTER('Fact','Fact'[Group1]>0)  )

CALCULATE (  DISTINCTCOUNT('Fact'[Key_Client]),  FILTER('Fact','Fact'[Group2]>0)  )

CALCULATE (  DISTINCTCOUNT('Fact'[Key_Client]),  FILTER('Fact','Fact'[Group3]>0)  )

 

Regarding the second measure, how can I create the bins and group by custom bins? ie (0-1000) (1000-2000) (2000-3000) and combine it with the other measure to display it all in a bar chart?

 

So far I have it as:

ovonel_1-1633330681368.png

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

It is suggested to UnPivot group columns and then refer to this blog - Group Bin in Power Query - Microsoft Power BI Community - to calculate group distribution.

 

Number of clients in each group = 
CALCULATE (
    DISTINCTCOUNT ( 'Fact'[Client] ),
    FILTER ( ALLEXCEPT ( 'Fact', 'Fact'[Group] ), 'Fact'[Value] > 0 )
)

Icey_0-1633509761928.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Icey
Community Support
Community Support

Hi @Anonymous ,

 

It is suggested to UnPivot group columns and then refer to this blog - Group Bin in Power Query - Microsoft Power BI Community - to calculate group distribution.

 

Number of clients in each group = 
CALCULATE (
    DISTINCTCOUNT ( 'Fact'[Client] ),
    FILTER ( ALLEXCEPT ( 'Fact', 'Fact'[Group] ), 'Fact'[Value] > 0 )
)

Icey_0-1633509761928.png

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors