Forum Discussion

JamesCarter's avatar
JamesCarter
Frequent Visitor
5 years ago
Solved

Dax Measure to return a single value from a column when using Min function on a different column

Hi I need to create a measure (and it has to be a measure, not a column, due wider reports/ calculations/ interdependencies). I need that measure to return the Ref which relates to the first start d...
  • parry2k's avatar
    5 years ago

    JamesCarter try this meaure

     

    Top Ref = CALCULATE ( MIN ( Ref[Ref] ), TOPN ( 1, ALLSELECTED ( Ref ), Ref[Start Date], ASC ) )

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • Ashish_Mathur's avatar
    5 years ago

    Hi,

    Try these measures

    First date = MIN(Data[Start Date])
    Measure = FIRSTNONBLANK ( TOPN ( 1, VALUES (Data[Ref]), [First date],ASC ), 1 )

    Drag the second measure to a card visual.  The result will be 123456.