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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.