Filter lastest Date Value

DSTUART

New Member
Joined
Nov 21, 2011
Messages
9
Hello all,
I have recently been given the task of transferring Spreadsheet/DB data into POWER BI and unfortunately my DAX skills are weak.
I have a report pulling Audit information from an Oracle table and I have dashboards providing Audit information related to whether a user has read a new version. In the example below 'Open Date' being less than 'Revision Date' indicates the areas of concerns. At the moment the report will show all discrepacies for a user but I only need to see the latest.
I have a Table that contains the following data

Doc No Name Open Date Revision Created Date Read
Doc NoNameOpen DateRevision Created DateRead
ABC123Jo Bloggs01/02/201606/02/2016FALSE
ABC123Jo Bloggs02/02/201607/03/2016FALSE
ABC123Jo Bloggs06/02/201616/07/2016FALSE
ABC123Jo Bloggs01/03/201607/03/2016FALSE
ABC123Doug Schmo01/02/201607/02/2016FALSE
ABC123Doug Schmo04/02/201616/02/2016FALSE
ABC123Doug Schmo24/02/201606/02/2016TRUE

<tbody>
</tbody><colgroup><col span="3"><col><col><col></colgroup>


What I am trying to achieve is a way to filter the table data to show a unique value for each Name (this being the last "Open Date" and ignoring all earlier dates). I thought I could use the Doc No and Name as a filter and then dispaly the MAX date but so far I have failed miserably.

I have the following set to report if the Open date is less than the version date, indicating that the latest version has not been read.(False).

Read = Audit[Open Date]>=Audit[Revision Created Date].

Apologies for my astounding lack of knowledge but Im trying to self teach at the moment and this is proving tricky.

Any help greatly appreciated.

Dave Stuart
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi Stuart,

I'm also learning so I hope this is helpful.

Is DAX a necessity?

Are you able to use Power Query first?

Using Power Query you can group by [Name] and [Doc No] and only show the Max Date.

This example filters the data to remove records where [Read] = TRUE

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Doc No", type text}, {"Name", type text}, {"Open Date", type datetime}, {"Revision Created Date", type datetime}, {"Read", type logical}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Read] = false)),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"Name", "Doc No"}, {{"Last Open", each List.Max([Open Date]), type datetime}})
in
    #"Grouped Rows"


Excel 2010
ABCDE
1Source Data
2Doc NoNameOpen DateRevision Created DateRead
3ABC123Jo Bloggs01/02/2016##########FALSE
4ABC123Jo Bloggs02/02/2016##########FALSE
5ABC123Jo Bloggs06/02/2016##########FALSE
6ABC123Jo Bloggs01/03/2016##########FALSE
7ABC123Doug Schmo01/02/2016##########FALSE
8ABC123Doug Schmo04/02/2016##########FALSE
9ABC123Doug Schmo24/02/2016##########TRUE
10
11
12
13
14
15
16Result
17NameDoc NoLast Open
18Jo BloggsABC12301/03/2016 00:00
19Doug SchmoABC12304/02/2016 00:00
Sheet1
 
Last edited:
Upvote 0
Thanks for Replying. Actually turned out a bit simpler than I thought. I created a measure, Open Date = MAX(Audit[Open Date]) and then used that on the Reports instead. It filters when used with the Name Data and gives the perfect results. Thanks for the help. Very much appreciated.
 
Upvote 0

Forum statistics

Threads
1,216,040
Messages
6,128,454
Members
449,455
Latest member
jesski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top