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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Datagulf
Responsive Resident
Responsive Resident

Binning a measure

I am trying to create a measure or a column that will create groups of a column. This measure is the number of days of a project that I have already established using datediff. The days vary from 1 day to 160 days. All I want is to achieve these groups and their frequencies. This was however achieved in another method here.

https://community.powerbi.com/t5/Desktop/Date-Difference-with-a-switch-between-two-dates-and-One-dat... . However, this is not working as perfectly when I add other columns like the project cost in all the projects. 
Whichever other methods is highly welcome. Thanks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Datagulf see attached and tweak as you see fit.

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

3 REPLIES 3
parry2k
Super User
Super User

@Datagulf see attached and tweak as you see fit.

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Datagulf it is a bit unclear what you are trying to achieve. I would recommend pasting sample data with the expected output. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Datagulf
Responsive Resident
Responsive Resident

Thanks, @parry2k 

I have a dataset (Table1) with the following sample data. 

Project IDDate Starteddate completedAmount used
104/02/202127/02/202134,533,200
207/02/2021 34,095,600
323/03/202107/04/202127,563,760
431/03/202105/05/202119,456,980
503/05/2021 13,904,710
601/06/2021 10,543,600

The task is to get the difference in days from start and end of the project. As you can see, some projects do not have a date completed. Hence for these ones, one should get the difference between the Start date and today so as to know how long these projects have taken before completion. 


The next task is to bin/group these projects by the time they have taken so far or they took to complete if already completed. The groups are already predetermined and are as follows.

 

0-30days, 30-60 days, 60 -90 days, More than 90 days. 

The ultimate solution is to have a table like this one. 

Group project ID FrequencyAmount Used Total
0-30 days7100,345,230
30-60days365,677,900
60-90 days223,567,677
More than 90 days00

I hope this is quite understandable now. Thanks.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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