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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

DAX way to find a value in a column adjacent to another value

Hi guys, newbie here!

 

I have a data structured like the follow

 

CustomerTypeValueFlag
A33.50
A32.21
A27.31
A24.90

 

I need to create a Matrix that shows, for every Type, the MIN(Value) and the corresponding Flag.

 

In this case I want this result:

CustomerTypeMIN(val)Flag
A32.20
 24.90

 

I tried woth the default setting (min of Flag) in the Visualizations pane, but I've noticed this new case in which tha flag 0 doesn't correspond with the minimum value for this Type. 

So basically I need something like a LOOKUP to retrieve the value (for the flag column) of the cell in the same row but for the value column.

 

 

thank you a lot!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous , 

Please refer to my pbix file to see if it helps you.

Create a measure.

_minvalue =
VAR _minvalue =
    CALCULATE (
        MIN ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Customer] = SELECTEDVALUE ( 'Table'[Customer] )
                && 'Table'[Type] = SELECTEDVALUE ( 'Table'[Type] )
        )
    )
RETURN
    IF (
        MAX ( 'Table'[Value] ) = _minvalue,
        MINX ( ALL ( 'Table' ), 'Table'[Flag] ),
        BLANK ()
    )

vpollymsft_0-1647936723539.png

f I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous , 

Please refer to my pbix file to see if it helps you.

Create a measure.

_minvalue =
VAR _minvalue =
    CALCULATE (
        MIN ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Customer] = SELECTEDVALUE ( 'Table'[Customer] )
                && 'Table'[Type] = SELECTEDVALUE ( 'Table'[Type] )
        )
    )
RETURN
    IF (
        MAX ( 'Table'[Value] ) = _minvalue,
        MINX ( ALL ( 'Table' ), 'Table'[Flag] ),
        BLANK ()
    )

vpollymsft_0-1647936723539.png

f I have misunderstood your meaning, please provide your pbix file without privacy information and desired output.

 

Best Regards

Community Support Team _ Polly

 

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

 

 

amitchandak
Super User
Super User

@Anonymous , Try measure like this for

 

flag and take min for value

 

Measure =
VAR __id = MAX ('Table'[Customer] )
VAR __date = CALCULATE ( Min('Table'[Value] ), ALLSELECTED ('Table' ), 'Table'[Customer] = __id )
return
CALCULATE ( Max ('Table'[Flag] ), VALUES ('Table'[Customer] ),'Table'[Customer] = __id,'Table'[Value] = __date )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors