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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How Can I use DAX to achieve my desired goal below ( Pulling a list of values first and then min.)

Hi Guys, 

 

Say I have 2 tables

Table:-1 ( From Here I need to extract the value of Height = 500m)

 

Tower IDBottom Dia  Top DiaHeight
123Cell 2Cell 1500
 

Table:-2 ( Now keeping 500 from table I need the minimum of the SRF values in table 2 corresponding to all heights less than 500 as min ( 0.25, 0.1,0.3,0.2) = 0.1 so on and so forth , so eventually for one tower ID I will have a single min SRF value.

 

Tower ID Mass height SRF
123Cell 26500.3
123Cell 25000.25
123Cell 24500.1
123Cell 22000.3
123Cell 2500.2
 

How can I achieve this using DAX or otherwise ?

Sorry I am really new and not sure how to even get started on this

1 ACCEPTED SOLUTION

The original code was intended for use as a measure. If you want to do it in a calculated column the below should work I think

Min SRF =
VAR CurrentHeight = 'Table1'[Height]
VAR Result =
    CALCULATE (
        MIN ( 'Table2'[SRF] ),
        KEEPFILTERS ( 'Table2'[Height] <= CurrentHeight )
    )
RETURN
    Result

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

can somebody please help me here to return a table instead of the min value ?

What are you trying to return exactly ?

Anonymous
Not applicable

Hi , 

 

I have created a new thread here below:

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Extension-of-a-previous-DAX-Query/m-...

 

I am trying to return a table..

johnt75
Super User
Super User

Make a one-to-many relationship from table 1 to table 2 and then you can try

Min SRF =
IF (
    ISINSCOPE ( 'Table1'[Tower ID] ),
    VAR CurrentHeight =
        SELECTEDVALUE ( 'Table1'[Height] )
    VAR Result =
        CALCULATE (
            MIN ( 'Table2'[SRF] ),
            KEEPFILTERS ( 'Table2'[Height] <= CurrentHeight )
        )
    RETURN
        Result
)
Anonymous
Not applicable

Unfortunately does not generate any output at all

 

Do I need the ISINSCOPE function ?

 

vito123_0-1692872894033.png

vito123_1-1692872933680.png

 

The original code was intended for use as a measure. If you want to do it in a calculated column the below should work I think

Min SRF =
VAR CurrentHeight = 'Table1'[Height]
VAR Result =
    CALCULATE (
        MIN ( 'Table2'[SRF] ),
        KEEPFILTERS ( 'Table2'[Height] <= CurrentHeight )
    )
RETURN
    Result

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.