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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.