Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
Hi All
I am struggling to correctly calculate bins_Segments.
I have an Annual Income table :
And I have a parameter that regulates the size of the bins. So depending on which Bin size I choose the number of rows in the below visual changes.
I have also created a table param_Segment to be able to calculate the number of bins in each segment.
My current Bins_segment calculation is:
Solved! Go to Solution.
Hi @xariet ,
According to your description, I create a same sample and here's my solution, create a measure.
Bins_segments =
CALCULATE (
COUNTROWS ( SUMMARIZE ( 'Annual Income', 'Annual Income'[Value1] ) ),
FILTER (
'Annual Income',
MOD (
'Annual Income'[Value1]
- MINX ( ALL ( 'Annual Income' ), 'Annual Income'[Value1] ),
SELECTEDVALUE ( 'Parameter'[What is bin size] )
) = 0
&& NOT (
ISEMPTY (
FILTER (
param_Segment,
NOT ( ISBLANK ( 'Annual Income'[Value1] ) )
&& param_Segment[Min] < 'Annual Income'[Value1]
&& param_Segment[Max] >= 'Annual Income'[Value1]
)
)
)
)
)
Get the correct result.
I attach my sample below for your reference.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Community Support Team_yanjiang
Hi @xariet ,
According to your description, I create a same sample and here's my solution, create a measure.
Bins_segments =
CALCULATE (
COUNTROWS ( SUMMARIZE ( 'Annual Income', 'Annual Income'[Value1] ) ),
FILTER (
'Annual Income',
MOD (
'Annual Income'[Value1]
- MINX ( ALL ( 'Annual Income' ), 'Annual Income'[Value1] ),
SELECTEDVALUE ( 'Parameter'[What is bin size] )
) = 0
&& NOT (
ISEMPTY (
FILTER (
param_Segment,
NOT ( ISBLANK ( 'Annual Income'[Value1] ) )
&& param_Segment[Min] < 'Annual Income'[Value1]
&& param_Segment[Max] >= 'Annual Income'[Value1]
)
)
)
)
)
Get the correct result.
I attach my sample below for your reference.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Community Support Team_yanjiang
Share sample pbix file to help you
I don't think I can attach the file to my post ..
@xariet , refer if my approach here can help
Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k
Thank you , do you by any chance know how to achieve this result? To group all bins where the income is more than 200,000. The below visual was done in Tableau, I can't figure out if this possible in Power BI..
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 24 | |
| 23 | |
| 19 |
| User | Count |
|---|---|
| 44 | |
| 32 | |
| 18 | |
| 17 | |
| 17 |