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
SarWal
Employee
Employee

How to compare values from another table? Segmentation in Dax

Hello - PBI Newbie here -

 

I am trying to segment accounts based on revenue. I have a table with Account information, Financial information and Segmentation requirements.

 

Account Columns:

[Account_Id] [Account Name] etc

Financial Columns

[Account_Id] [Revenue] etc

 

Segmentation Columns:

[Segmentation Name] [Max Revenue] [Min Revenue]

 

What is the best approach to solve this?

I want a table/chart with the Account Name, Revenue, and Segmentaion Name, or to be able to filter a page based off the segmentation. I am struggling with the format of the column I'm adding to the Financial table in order to calculate what segment each account is in. NOTE there is only one line item for each account in the financials table.

 

Thanks in advance for your help!

 

 

Note - I've been looking at this page and trying to convert it to columns (rather than measures), and not having any luck.

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@SarWal

 

You can try to add a calculated column as below.

Segmentation Name = 
CALCULATE (
    VALUES ( Segmentation[Segmentation Name] ),
    FILTER (
        Segmentation,
        Segmentation[Min Revenue] <= Financial[Revenue]
            && Segmentation[Max Revenue] >= Financial[Revenue]
    )
)

Capture.PNG

 

Capture.PNG

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee

@SarWal

 

You can try to add a calculated column as below.

Segmentation Name = 
CALCULATE (
    VALUES ( Segmentation[Segmentation Name] ),
    FILTER (
        Segmentation,
        Segmentation[Min Revenue] <= Financial[Revenue]
            && Segmentation[Max Revenue] >= Financial[Revenue]
    )
)

Capture.PNG

 

Capture.PNG

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.