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
yiying
Helper I
Helper I

How to create bins for measure? urgent

I just created a new measure like this

 

PMT per Work=divide(sum(PMT),distinctcount(work order ID))

 

So now I have a list of employees' average payment.

 

                          PMT per Work      

employee ID1   $150

employee ID2    $210

employee ID3    $320

employee ID$    $130

 

Now I want ot created a bin so I can get this

 

 PMT per Work bin            Count

$100-200                               2

$200-300                               1

$300-400                               1

 

 

I tried to created another measure using if function. However it would give me bins. It will give me just one number for the whole data set. 

 

Thanks you!!

8 REPLIES 8
exlmmk
Frequent Visitor

Posting this in case it is helpful as I was looking for a similar solution to this same problem and this video explained exactly what I needed:

Dynamic Banding & Segmenting Example In Power BI Using DAX
https://www.youtube.com/watch?v=3BlTXhhbOro


Anonymous
Not applicable

Did you ever figure this out?

@Anonymous - Perhaps, see what you think about this Quick Measure:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-ABC-Classification/m-p/479146

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

You want a measure that creates a VAR using SUMMARIZE and then do a COUNTX using that table. See this article:

 

https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you for the answer! But I am still confused. So I should create a new table with my bins first? 

You could, or you could just do a "temp table" by creating a VAR that does a SUMMARIZE. I'm actually sitting next to Michael Carlo from Power BI Tips and he sent me this link:

 

https://powerbi.tips/2016/04/power-bi-histogram-with-bins/

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I follow every steps in this Link but I still can not do it. I think the problem is that the 2010 Census data in this tutorial is a column but my data is a measure. 

Thinking about this, I don't see how you are going to do what you want without creating a separate table with your bins and then creating a calculated column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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 Solution Authors
Top Kudoed Authors