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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Ghuiles
Advocate V
Advocate V

Dynamic segmentation with criteria depending on the customer group

Hello

 

I have a Sales fact table, based on which i calculte the sum of sales, sum or cost, and then the margin in %.

 

The table is narrow, so all amounts are in only one column.

The classification of the customer is based on the Margin% (negative, low, high).

 

Now the difficulty i am having, is that i have different customer groups (not too many) for which the definition of what is low or high ist different.

 

Say for example:

 Min Cust Grp AMin Cust Grp BMax Cust Grp AMax Cust Grp B
Profitable customers3%4%9999%9999%
Low margin customers0%0%3%4%
Negative margin customers-9999%-9999%0%0%

 

I understood that the method Dynamic Segmentation (https://www.daxpatterns.com/dynamic-segmentation/) could help me, but how can i make the threshold in the formula depending on the customer group?


I already spent some time on this, so any help would be apreciated.

Cheers. G.

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Ghuiles 

 

Yes the scenario in the article "Dynamic Segmentation // DAX patterns" does not include relationships as you calculating the values between Min and Max, however, you have introduced an extra concept of Customer Groups and you want the model to obey this filters so relationship or using DAX is necessary.

 

Hope this helps.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Ghuiles 

 

You can build a segment table like below, and add a relationship with Cust Grp or Use TREATAS function.

image.png

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Hi Mariusz!

 

Thanks @Mariusz  for your very fast reply!

 

But I am surprised. I thought that the segmentation table HAS TO be without relathionship to the fact table.

Or did i miss something?

 

In your proposal, the model with the relationships will then be like this:

Fact Table <-- DimCustomers Table <-- DimCustomersGrp Tabl <-- Sementation table.

 

Right?

Cheers. G.

Mariusz
Community Champion
Community Champion

Hi @Ghuiles 

 

Yes the scenario in the article "Dynamic Segmentation // DAX patterns" does not include relationships as you calculating the values between Min and Max, however, you have introduced an extra concept of Customer Groups and you want the model to obey this filters so relationship or using DAX is necessary.

 

Hope this helps.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Many Thanks @Mariusz  😉

G.

@Mariusz it seems to work 🙂 

So, many thanks to you 🙂

And on the top of that, I learned then quite something 🙂

I will have to continue my checks. I will let you know if something does not match.

Cheers. G.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.