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
Anonymous
Not applicable

Report filter automatic result

Hello experts!

 

I need to filter the report to recognize the most recent date, then filter to only show results for the group of that date. For example...

 

The most recent event date on the database = 1/29/16 .  So I need the filter to ONLY show results for 6 days in event# 152.  This will prevent me from having to manually code the event# in the report each time a new event happens.  Any ideas?

 

Im a newbie to this, so a simple-mans answer would be much appreciated 😄

 

DATEEvent#Day of EventRevCat1RevCat2RevCat3RevCat4RevCat5
1/3/20161501$0.00 $0.00 $0.00 $0.00 $0.00 
1/3/20161502$0.00 $0.00 $0.00 $0.21 ($104.00)
1/4/20161503$50.00 $0.00 $0.00 $1,948.89 $308.50 
1/5/20161511$0.00 $0.00 $0.00 $0.00 $0.00 
1/6/20161512$0.00 $0.00 $0.00 $779.61 $307.00 
1/7/20161513$0.00 $0.00 $413.00 $897.78 $1,011.00 
1/8/20161514$0.00 $0.00 $0.00 $2,175.40 ($618.00)
1/9/20161515$0.00 $1,040.50 $0.00 ($21.06)$614.50 
1/10/20161516$28.50 $0.00 $0.00 $445.66 $526.00 
1/11/20161521$0.00 $0.00 $0.00 $810.06 $662.50 
1/12/20161522$360.50 $0.00 $0.00 $344.23 $1,268.00 
1/27/20161523$0.00 $0.00 $0.00 $720.20 $1,301.00 
1/27/20161524$0.00 $0.00 $0.00 $956.91 $643.50 
1/28/20161525$0.00 $0.00 $287.00 $1,158.48 $2,290.50 
1/29/20161526$198.00 $21,876.00 $276.00 $1,335.29 $726.00 
9 REPLIES 9
v-caliao-msft
Employee
Employee

Hi Pchapple,

 

According to your description, you need to only show most recent event date with add any filter, right?

 

I have tested it on my local environment, there is no any Minimum and Maximum option for a date value.
Capture.PNG

So you need to create another table to get only the lastest date for each event, and then use the new created table to create visuals.

Create a column in the original table
LatestDate = CALCULATE(MAX(Latest[DATE]),ALLEXCEPT(Latest,Latest[Event#]))
Then create a new table
LatestEvent = SUMMARIZE(Latest,Latest[Event#])
Add those columns to the new created table.
LatestDate = LOOKUPVALUE(Latest[LatestDate],Latest[Event#],LatestEvent[Event#])
RevCat1 = LOOKUPVALUE(Latest[RevCat1],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
RevCat2 = LOOKUPVALUE(Latest[RevCat2],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
RevCat3 = LOOKUPVALUE(Latest[RevCat3],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
RevCat4 = LOOKUPVALUE(Latest[RevCat4],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
RevCat5 = LOOKUPVALUE(Latest[RevCat5],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])

 Capture1.PNGCapture3.PNG

 

Regards,

Charlie Liao

Anonymous
Not applicable

Thanks @v-caliao-msft

 

When you are referecning the table Latest... for example...

 

LatestDate = CALCULATE(MAX(Latest[DATE]),ALLEXCEPT(Latest,Latest[Event#]))

 

What table are you refering to?  Is it the original table? When I try to create the new column in the original table as you described, its giving me an error.  

 

Sorry for the newbie questions...

 

Paul

Hi Pchapple,

 

Yes, create calculated column in the original table. Please share us the error message, so that we can make further analysis.

 

Regards,

Charlie Liao

Anonymous
Not applicable

Hi @v-caliao-msft

Have created the column as suggested however the process for creating a table seems unclear.  Maybe Im not creating the table rtight, but it does not seem that the formulae works when I use ENTER DATA to create a new table.

 

You say "Then create a new table
LatestEvent = SUMMARIZE(Latest,Latest[Event#])" however this does not seem to return any results when pasted into the 1st cell

 

Thanks

Hi Pchapple,

 

I have create a table by using Enter Data, everything works fine. Here are the steps for you reference.

  1. Create a table using Enter Data (change the table name to Latest) and then click Loda button.
    Capture.PNG
  2. Click Data on the left pane, and click Modeling the click New Column. Type the DAX below.
    LatestDate = CALCULATE(MAX(Latest[DATE]),ALLEXCEPT(Latest,Latest[Event#]))
    Capture2.PNG
  3. Click New Table and type the DAX below.
    LatestEvent = SUMMARIZE(Latest,Latest[Event#])
    Capture3.PNG
  4. Add those columns to the new created table.
    LatestDate = LOOKUPVALUE(Latest[LatestDate],Latest[Event#],LatestEvent[Event#])
    RevCat1 = LOOKUPVALUE(Latest[RevCat1],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
    RevCat2 = LOOKUPVALUE(Latest[RevCat2],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
    RevCat3 = LOOKUPVALUE(Latest[RevCat3],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
    RevCat4 = LOOKUPVALUE(Latest[RevCat4],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
    RevCat5 = LOOKUPVALUE(Latest[RevCat5],Latest[DATE],LatestEvent[LatestDate],Latest[Event#],LatestEvent[Event#])
    Capture4.PNG

 

Regards,

Charlie Liao

 

Sean
Community Champion
Community Champion

@Anonymous Create the 2 Measures and then replace [Date] in your Table Visual with Last Date and [Event#] with Last Event#

 

Last Date = 
CALCULATE ( LASTDATE ( 'Table'[DATE] ), ALL ( 'Table' ) )

Last Event# =
CALCULATE (
    VALUES ( 'Table'[Event#] ),
    LASTDATE ( 'Table'[DATE] ),
    ALL ( 'Table' )
)
Anonymous
Not applicable

Thanks!  This works to create the data for the most recent Event# recorded (thakn you!!).  However, the system won't let me use this Measure as a Report Filter.  (can't drag it into the report filter box).  Any ideas?

Sean
Community Champion
Community Champion

Last Date formula will work as a column too...

Anonymous
Not applicable

Thanks Sean, Sorry for the rooky questions.  How do I use these in the Page FIlter setting?  When I drag the info in (either columns or measurews), it still requires me to select and event#

 

Basically, Im trying not to over load the reader with data, so want the page to automatically filter to show only the current event data.  (most recent event).  

 

Thanks for your support on this!

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.

Top Solution Authors