Search code examples
daxpowerbi-desktop

Power BI DAX - How can I extract the following Information?


Say I have 2 tables

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

Tower ID Bottom Dia Top Dia Height
123 Cell 2 Cell 1 500

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
123 Cell 2 650 0.3
123 Cell 2 500 0.25
123 Cell 2 450 0.1
123 Cell 2 200 0.3
123 Cell 2 50 0.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


Solution

  • If you create a relationship between the two tables, then you can use something like this in Table1:

    MINX(
         FILTER('Table2',[height]<500),
         [SRF])
    

    MINX will use the relationship between table1 and table2 to return only the related records, and then filter, and finally return the lowest SRF value.