skip to main content
Power BI
    • What is Power BI
    • Why Power BI
    • Customer stories
    • Data visuals
    • Security
    • Power BI Desktop
    • Power BI Pro
    • Power BI Premium
    • Power BI Mobile
    • Power BI Embedded
    • Power BI Report Server
  • Pricing
    • Azure + Power BI
    • Microsoft 365 + Power BI
    • Dynamics 365 + Power BI
      • Energy
      • Healthcare
      • Manufacturing
      • Media
      • Retail
    • For analysts
    • For IT
      • Overview
      • Embedded analytics
      • Power BI visuals
      • Automation
      • Documentation
      • Community
    • Partners Overview
    • Solutions Partners
    • BI Specialized Partners
    • Power BI CSOs
    • Fabric Partner Community
    • Training
    • Getting started
      • Overview
      • Self-guided learning
      • Webinars
      • Documentation
      • Roadmap
      • Overview
      • Issues
      • Give feedback
    • Blog
    • Business intelligence topics
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Events
    • User groups
    • Community blog
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Power BI forums
    • Updates
    • News & Announcements
    • Get Help with Power BI
    • Desktop
    • Service
    • Report Server
    • Power Query
    • Mobile Apps
    • Developer
    • DAX Commands and Tips
    • Custom Visuals Development Discussion
    • Health and Life Sciences
    • Power BI Spanish forums
    • Translated Spanish Desktop
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Training and Consulting
    • Instructor Led Training
    • Galleries
    • Community Connections & How-To Videos
    • COVID-19 Data Stories Gallery
    • Themes Gallery
    • Data Stories Gallery
    • R Script Showcase
    • Webinars and Video Gallery
    • Quick Measures Gallery
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Events
    • Ideas
    • Custom Visuals Ideas
    • Issues
    • Issues
    • Events
    • Upcoming Events
    • Community Engagement
    • T-Shirt Design Challenge 2023
    • Community Blog
    • Power BI Community Blog
    • Custom Visuals Community Blog
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 

    Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

    • Power BI forums
    • Galleries
    • Quick Measures Gallery
    • Dynamic Segmentation/ Bucketing/ Binning

    Dynamic Segmentation/ Bucketing/ Binning

    09-22-2020 04:44 AM

    Super User amitchandak
    Super User
    8360 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    amitchandak
    Super User amitchandak
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Dynamic Segmentation/ Bucketing/ Binning

    ‎09-22-2020 04:44 AM

    Dynamic Segmentation/ Bucketing/ Binning

     

    Created an independent bucket Table.

    Create measures that take advantage of those buckets

     

    Actual Measure 

    Margin % = DIVIDE([Margin],[Sales]) 

     

    The measure we would like to become the parameter/slicer

    Margin Type = Switch( True(),
    [Margin %] < -.2 , "Very Bad",
    [Margin %] <0 , "Bad",
    [Margin %] <.1 , "Netural",
    [Margin %] <.25 , "Good",
    "Very Good"
    )

     

    The independent Table we created 

    Start Limit End Limit Bucket
    -1000 -0.2 Very Bad
    -0.2 0 Bad
    0 0.1 Netrual
    0.1 0.25 Good
    0.25 1000 Very Good

     

     

    Bucketed measures 

     

    Margin Bucket = COUNTX(filter(VALUES(customer[Customer Id]),[Margin %] >=Min('Margin Bucket'[Start Limit]) && [Margin %] <max('Margin Bucket'[End Limit])),customer[Customer Id])
    Avg Margin Bucket = AVERAGEX(filter(VALUES(customer[Customer Id]),[Margin %] >=Min('Margin Bucket'[Start Limit]) && [Margin %] <max('Margin Bucket'[End Limit])),[Margin %])

     

     

     

    eyJrIjoiYmFmMTc0NzYtYzMzNS00NTU0LWFjNGYtODc4ZjA0ODM0MzVjIiwidCI6ImVhOGJkMWZkLWFjMzQtNGFlMi1iNDIxLTZjZmEyZmNmZjI0MyJ9



    !! Power BI 101 Interview questions !! !! Master Microsoft Fabric- 36 Videos !!
    Microsoft Power BI Learning Resources, 2023 !!
    Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
    Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
    Retail Bucket Data.pbix
    Labels:
    • Labels:
    • Mathematical
    • Totals
    Message 1 of 3
    8,360 Views
    5
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    alialsayer
    alialsayer Helper I
    Helper I
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-22-2022 12:53 AM

    This is fantastic; thank you for your prompt response; however, I have a slightly different situation. First, I have to group values by date for each customer, and then I should use the bucket. I am trying to find a way to do this in the DAX function instead of grouping values for each customer & date in a table to avoid performance issues.

    Message 3 of 3
    4,286 Views
    0
    Reply
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎10-05-2021 09:31 PM

    Hi Amit,

     

    I have followed this and getting below result which is incorrect:

    Total is correct but it is not segregating according to buckets.

    varshakrishna08_0-1633494406835.png

    Till here its fine, 

    varshakrishna08_1-1633494456361.png

     

    But as soon as I add Measure as below it only gives total but does not segregate

    varshakrishna08_2-1633494501150.png

     

    My Measure is below:

    Age Bucket = COUNTX(filter(VALUES(TrusteeClaimsList_Decision[PolicyCaseBenefitKey]),[Age of Pending Claims] >=Min('Age_Pending_Bucket Table'[Start Limit]) && [Age of Pending Claims] <=max('Age_Pending_Bucket Table'[End Limit])),TrusteeClaimsList_Decision[PolicyCaseBenefitKey])
     
     
    Can you please help, it should be as below:
    varshakrishna08_3-1633494536778.png

     

     
    Message 2 of 3
    7,536 Views
    0
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign in
    • Sign up

    Browse

    • Solutions
    • Partners
    • Consulting Services

    Downloads

    • Power BI Desktop
    • Power BI Mobile
    • Power BI Report Server
    • See all downloads

    Learn

    • Guided learning
    • Documentation
    • Support
    • Community
    • Give feedback
    • Webinars
    • Developers
    • Blog
    • Newsletter

    © 2023 Microsoft

    Follow Power BI

    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    Consumer Privacy Act (CCPA) Opt-Out Icon Your Privacy Choices