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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Hank_
Helper I
Helper I

Custom Clustering

Hi everybody!

 

I'd like to cluster durations, and use them in matrix, bar charts, legends, filters.  

These are calculated with DAX. In this way I can only make simple tables (not matrix).

 

My calculation:

 

Durations are calculated per each object, that passes different states, as simple subtraction between max_date and min_date.

 

For example:

 

ITEMSTATEDATE
object 1on draftdate
object 1start workingdate
object 1finished workingdate
object 1dispatcheddate

 

Duration calculates the total days between last state and first state.

 

I made automatic clustering, and then can create graphs, but PBI decides the rule and I can't change it. 

 

So I calculated clusters with this simple formula:

Duration cluster = IF([duration]<30, "OK" , IF([duration]>60, "LATE", "WARNING"))
 
My question:

 

How can I produce custom clusters that I can use everywhere? 

Is there a way to change automatic clustering?

4 REPLIES 4
parry2k
Super User
Super User

@Hank_ I believe Duration Cluster you added as a measure and you cannot use it the way you want it. Check this Dynamic Segmentation post and make it work in your model.

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals 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.

PhilipTreacy
Super User
Super User

Hi @Hank_ 

Your qs How can I produce custom clusters that I can use everywhere? - haven't you already done this with your IF ?

If you have specific clusters/buckets/categrories that you want your data to be assigned to then this is the way I'd approach it.

If you need furhter help please supply some real data that can be worked with.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hello Philip, here the link to the pbix https://1drv.ms/u/s!ApBVHbcaAbTVhlXycrEG_MfxEdGe?e=ycB4VF 

Hi Philip, yes I made this clustering with DAX but I cannot use it in legend nor axis in a bar chart: I can put it only in tooltip or values if I change clusters to numbers (1, 2, 3 instead of OK, WARNING, LATE).

 

I will produce a file: I have to change all company data and have dozens of table in my model.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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