Forum Discussion

p-caron's avatar
p-caron
New Member
7 years ago
Solved

How to display the most recent value when grouping ?

Hi,

 

I'm starting with PowerBI, so my question is probably obvious ...

I have data that represent customers searches :

date | term | number of results | ....

 

I group my data by term with a slicer on time, no problem.

I have one row per term and the number of times customers make this search.
Now, I want to add a column to display the last (most recent) value of "number of results".

The idea is : During the last 2 month, I have 12345 searches on the keyword "mouse". It can be relevant for a marketer to know approximately how many products ours search engine actualy show for this search.

 

I try severals thing ... but I can not.

I want something like to get value associate with the LASTNONBLANK date ... but I didn't find.

 

Some help would be appreciate !

 

Regards,

  • Hi p-caron 

     

    Try this Measure if it works for you.

     

    CALCULATE( 
        LASTNONBLANK( 'Table'[Text], 'Table'[Text] ), 
        LASTDATE( 'Table'[Date] ) 
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

3 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi p-caron 

     

    Try this Measure if it works for you.

     

    CALCULATE( 
        LASTNONBLANK( 'Table'[Text], 'Table'[Text] ), 
        LASTDATE( 'Table'[Date] ) 
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

    • p-caron's avatar
      p-caron
      New Member

      Thank you very much !

       

      This is exactly what I want.

       

      Regards,