Forum Discussion

batmanadk's avatar
batmanadk
Helper I
5 years ago
Solved

First Value

I´ve edited the post to try to make it clearer. Thanks!  So, This is a restaurant´s report and what we are trying to find out is what waiter sold the most of X product. So data is generated when a u...
  • v-robertq-msft's avatar
    5 years ago

    Hi, batmanadk 

    According to your description and sample data, I think you want to get a column [Ticket User Owner] which is the first User group by Ticket Id, you can try this calculated column:

    TicketUserOwner1 =
    
    var _minorderid=
    
    CALCULATE(MIN('Orders'[OrderId]),FILTER('Orders',[TicketId]=EARLIER(Orders[TicketId])))
    
    return
    
    CALCULATE(MIN('Orders'[User]),FILTER('Orders',[OrderId]=_minorderid))

    Then place the column into the table chart to replace the original [TicketUserOwner], sort by [Revenue] desc, you can get what you want, like this:

     

    You can download my test pbix file here

     

    Best Regards,

    Community Support Team _Robert Qin

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