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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
StuartSmith
Power Participant
Power Participant

Display most recent date in table.

I have the below report and need the report to only show the most recent rows for each country/carrier, so as an example it would show the 2 rows highlighted.  I have searched on here and found a few similar questions, but nothing that i can re-use.

 

Any ideas? Thanks in advance.

 

2020-09-08_15-51-02.jpg

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @StuartSmith 

 

Based on your description, I created data to reproduce your sceanrio. The pbix file is attached in the end.

Table:

a1.png

 

You may create a measure as below.

Visual Control = 
var tab = 
SUMMARIZE(
    ALL('Table'),
    'Table'[Country],
    'Table'[Carrier],
    "LastDate",
    MAX('Table'[Explicit Invoice Ymv])
)
var _date =
MAXX(
    FILTER(
        tab,
        [Country]=SELECTEDVALUE('Table'[Country])&&
        [Carrier]=SELECTEDVALUE('Table'[Carrier])
    ),
    [LastDate]
)
return
IF(
    SELECTEDVALUE('Table'[Explicit Invoice Ymv])=_date,
    1,0
)

 

Finally you need to put the measure in the visual level filter to get the result.

a2.png

 

Best Regards

Allan

 

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

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Do you want this at the leve of the Query Editor or only at the level of the visual? 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-alq-msft
Community Support
Community Support

Hi, @StuartSmith 

 

Based on your description, I created data to reproduce your sceanrio. The pbix file is attached in the end.

Table:

a1.png

 

You may create a measure as below.

Visual Control = 
var tab = 
SUMMARIZE(
    ALL('Table'),
    'Table'[Country],
    'Table'[Carrier],
    "LastDate",
    MAX('Table'[Explicit Invoice Ymv])
)
var _date =
MAXX(
    FILTER(
        tab,
        [Country]=SELECTEDVALUE('Table'[Country])&&
        [Carrier]=SELECTEDVALUE('Table'[Carrier])
    ),
    [LastDate]
)
return
IF(
    SELECTEDVALUE('Table'[Explicit Invoice Ymv])=_date,
    1,0
)

 

Finally you need to put the measure in the visual level filter to get the result.

a2.png

 

Best Regards

Allan

 

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

amitchandak
Super User
Super User

@StuartSmith , use these with region, countru carrier

measures

last No of SIM = lastnonblankvalue(table[explict Invoice YMv] , max(Table[No of SIM]))
last net amount = lastnonblankvalue(table[explict Invoice YMv] , sum(Table[net amount]))

 

use max of table[explict Invoice YMv]

edhans
Super User
Super User

Hi @StuartSmith - you can create a Top N filter on that date field. Select the visual, then the Filter Pane.

  1. Change the filter type to Top N
  2. Show top 1 items
  3. Drag that date field into the By Value and change it to show the latest value.

 

edhans_0-1599578946357.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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