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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
user_1111
New Member

SOS HELP ! related or lookupvalue from another table

Hello everyone! I need some help, colleagues.

I have a fact table showing the quantity by segment and duration of employee tenure, and there is a reference table with norms based on the segment and duration of employee tenure.

How can I use DAX  to fetch the value and correctly distribute the quantity range that meets the norms, and calculate the Percentage of Norm Completion based on the segment and duration of employee tenure? There is no direct relationship - I created an index column for the segment. The norm values are different for each segment.

user_1111_0-1690090555608.png

 

 

I am attaching screenshots of the tables for better understanding.

user_1111_0-1690090037072.png
need result an screenshot :

user_1111_0-1690090986378.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @user_1111 ,

 

I suggest you to transform your tables first as below.

New Table:

vrzhoumsft_0-1690360852483.png

Measure:

Range =
VAR _PART1 =
    CALCULATE (
        MAX ( 'Table'[Norm] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
                && 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
                && 'Table'[Norm] <= MAX ( 'Table (2)'[Norm] )
        )
    )
VAR _VALUE1 =
    CALCULATE (
        SUM ( 'Table'[Percentage] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
                && 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
                && 'Table'[Norm] = _PART1
        )
    )
VAR _PART2 =
    CALCULATE (
        MAX ( 'Table'[Percentage] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
                && 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
                && 'Table'[Norm] > MAX ( 'Table (2)'[Norm] )
        )
    )
RETURN
    IF ( _PART1 = BLANK (), _PART2, _VALUE1 )

Result is as below.

vrzhoumsft_1-1690360868837.png

You can download my attatchment to learn more details.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @user_1111 ,

 

I suggest you to transform your tables first as below.

New Table:

vrzhoumsft_0-1690360852483.png

Measure:

Range =
VAR _PART1 =
    CALCULATE (
        MAX ( 'Table'[Norm] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
                && 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
                && 'Table'[Norm] <= MAX ( 'Table (2)'[Norm] )
        )
    )
VAR _VALUE1 =
    CALCULATE (
        SUM ( 'Table'[Percentage] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
                && 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
                && 'Table'[Norm] = _PART1
        )
    )
VAR _PART2 =
    CALCULATE (
        MAX ( 'Table'[Percentage] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Segment] = MAX ( 'Table (2)'[Segment] )
                && 'Table'[Tenure] = MAX ( 'Table (2)'[Tenure] )
                && 'Table'[Norm] > MAX ( 'Table (2)'[Norm] )
        )
    )
RETURN
    IF ( _PART1 = BLANK (), _PART2, _VALUE1 )

Result is as below.

vrzhoumsft_1-1690360868837.png

You can download my attatchment to learn more details.

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.