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
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
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.

Top Solution Authors