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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
matsahiro
Helper II
Helper II

DAX Binning Aggregating into one Bin Instead of 5 Created Bins

Hello, 

 

I created a few DAX measures to create 5 bins that all have the same number of records each time. Here are those measures.

 

Score Rank = RANKX(ALLSELECTED(PredictedScores),CALCULATE(SUM(PredictedScores[Score])),,0)
 
Quintile = DIVIDE([Score Rank],CALCULATE(COUNTROWS(PredictedScores),ALLSELECTED(PredictedScores)))
 
Quintile Binning =
IF([Quintile] <=.2, 1,
IF([Quintile] <= .4, 2,
IF([Quintile] <= .6, 3,
IF([Quintile] <= .8, 4,
IF([Quintile] <=1, 5,100)))))
 
Basically what Im doing with the DAX is ranking all the scores within my table, then binning those scores based off of their rank. I needed the AllSelected because im constantly filtering what scores will be binned.
 
The PredictedScores table looks something like this.
 
AccountID |  Score
1                |   .34
2                |   .29
3                |   .37
4                |   .50
5                |   .93
6                |   .58
7                |   .17
8                |   .69
9                |   .89
10              |   .95
 
When I have all of the scores listed out, the correct binning is displayed next to each score, but when I make a new table visual with the Quintile Binning next to the Count of Account ID, instead of giving a breakout of the number of accounts in each bin, im left with all of the bins aggregated into one. Any thoughts on this? Thank you very much. 
 
What I'd Like
 
Quintile Bin |  Count of AccountID
1                 |          2
2                 |          2
3                 |          2
4                 |          2
5                 |          2
 
 
 
What actually appears (I don't want)
 
Quintile Bin |  Count of AccountID
1                 |          10
 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@matsahiro , If you need to use that to the group; you need to create an independent table and use that in measure

 

refer to my video: https://youtu.be/CuczXPj0N-k

 

or

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@matsahiro , If you need to use that to the group; you need to create an independent table and use that in measure

 

refer to my video: https://youtu.be/CuczXPj0N-k

 

or

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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