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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
cdawidow
Helper III
Helper III

Date Segmentations based on multiple measures

 

Hi guys, I need to segment my products into 4 groups all with distinct MIN & MAX ranges as shown below.  I am wondering how best to create a dax measure to segment my products into these groups.  Furthermore, I need to essentially have the ability to use that Product Type Group Name to be used within the Legend Field of a visuals (Scatter Chart) to visually showcase the sgementation over time.  Currently, the scatter chart legend field only accepts colum references and not measures.  Any help would be greatly appreciated!!

 

SEGMENTATION.PNG

 

1 REPLY 1
technolog
Super User
Super User

First, we need to create a calculated column instead of a measure since the scatter chart legend field only accepts column references. Let's create a new column named 'Product Type' in your table.

Here's a DAX formula for the 'Product Type' column:

Product Type =
VAR SalesRank = [Sales Rank]
VAR MarginRank = [Margin Rank]

RETURN
IF(
(SalesRank >= 950 && SalesRank <= 1050) && (MarginRank >= 950 && MarginRank <= 1050), "CORE",
IF(
(SalesRank >= 850 && SalesRank < 950) && (MarginRank >= 850 && MarginRank < 950), "VITAL",
IF(
(SalesRank >= 0 && SalesRank < 850) && (MarginRank >= 850 && MarginRank <= 1050), "POOR",
IF(
(SalesRank >= 0 && SalesRank < 850) && (MarginRank >= 0 && MarginRank < 850), "BAD",
BLANK()
)
)
)
)
This formula checks the Sales Rank and Margin Rank of each product and assigns it to one of the four categories. If a product doesn't fit into any of the categories, it will return a blank value.

Once you've added this column, you can use the 'Product Type' column in the Legend Field of your scatter chart to visually showcase the segmentation over time. This way, each product will be color-coded based on its segment, making it easy to see how products are distributed across the four categories over time.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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