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
iDataDrew
Advocate IV
Advocate IV

Obtaining current state metrics from snapshot data. Measures or current state table?

 I have a table that has snapshot data.  There are multiple snapshots each day.  I need to create current state measures that only take into account the latest snapshot.  I'm wondering, regarding performance, is the best way to address this by creating measures that filter by the latest date and time or create a duplicate table that removes duplicates (Category) and only keeps the latest snapshot?  Keep in mind, if I do the latter, I'll have to do this for multiple tables in my data model.  Example data is below.

 

 

DateTimeCategoryCost
8/4/201800:16:55Group 1563180
8/4/201801:14:27Group 1563180
8/4/201802:20:15Group 1563180
8/4/201803:14:43Group 1563180
8/4/201804:13:56Group 1563180
8/4/201805:15:28Group 1563180
8/4/201806:14:09Group 1563180
8/4/201807:14:23Group 1563180
8/4/201808:15:31Group 1563180
8/4/201809:13:59Group 1563180
8/4/201810:13:34Group 1563180
8/4/201811:14:48Group 1563180
8/4/201812:15:48Group 1563180
8/4/201813:14:25Group 1563180
8/4/201814:14:17Group 1563180
8/4/201815:13:27Group 1563180
8/4/201816:15:04Group 1563180
8/4/201800:16:55Group 28060
8/4/201801:14:27Group 28060
8/4/201802:20:15Group 28060
8/4/201803:14:43Group 28060
8/4/201804:13:56Group 28060
8/4/201805:15:28Group 28060
8/4/201806:14:09Group 28060
8/4/201807:14:23Group 28060
8/4/201808:15:31Group 28060
8/4/201809:13:59Group 28060
8/4/201810:13:34Group 28060
8/4/201811:14:48Group 28060
8/4/201812:15:48Group 28060
8/4/201813:14:25Group 28060
8/4/201814:14:17Group 28060
8/4/201815:13:27Group 28060
8/4/201816:15:04Group 28060
8/4/201800:16:55Group 31689792.06
8/4/201801:14:27Group 31689792.06
8/4/201802:20:15Group 31689792.06
8/4/201803:14:43Group 31689792.06
8/4/201804:13:56Group 31689792.06
8/4/201805:15:28Group 31689792.06
8/4/201806:14:09Group 31689792.06
8/4/201807:14:23Group 31689792.06
8/4/201808:15:31Group 31689792.06
8/4/201809:13:59Group 31689792.06
8/4/201810:13:34Group 31689792.06
8/4/201811:14:48Group 31689792.06
8/4/201812:15:48Group 31689792.06
8/4/201813:14:25Group 31689792.06
8/4/201814:14:17Group 31689792.06
8/4/201815:13:27Group 31689792.06
8/4/201816:15:04Group 31689792.06
8/4/201800:16:55Group 474360
8/4/201801:14:27Group 474360
8/4/201802:20:15Group 474360
8/4/201803:14:43Group 474360
8/4/201804:13:56Group 474360
8/4/201805:15:28Group 474360
8/4/201806:14:09Group 474360
8/4/201807:14:23Group 474360
8/4/201808:15:31Group 474360
8/4/201809:13:59Group 474360
8/4/201810:13:34Group 474360
8/4/201811:14:48Group 474360
8/4/201812:15:48Group 474360
8/4/201813:14:25Group 474360
8/4/201814:14:17Group 474360
8/4/201815:13:27Group 474360
8/4/201816:15:04Group 474360
8/4/201800:16:55Group 5229500
8/4/201801:14:27Group 5229500
8/4/201802:20:15Group 5229500
8/4/201803:14:43Group 5229500
8/4/201804:13:56Group 5229500
8/4/201805:15:28Group 5229500
8/4/201806:14:09Group 5229500
8/4/201807:14:23Group 5229500
8/4/201808:15:31Group 5229500
8/4/201809:13:59Group 5229500
8/4/201810:13:34Group 5229500
8/4/201811:14:48Group 5229500
8/4/201812:15:48Group 5229500
8/4/201813:14:25Group 5229500
8/4/201814:14:17Group 5229500
8/4/201815:13:27Group 5229500
8/4/201816:15:04Group 5229500
1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi iDataDrew,

 

To achieve your requirement, create a measure using DAX as below:

Max Time = CALCULATE(MAX(Table1[Time]), FILTER(ALLEXCEPT(Table1, Table1[Category]), Table1[Date] = MAX(Table1[Date]) && Table1[Time] = MAX(Table1[Time])))

捕获.PNG  

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi iDataDrew,

 

To achieve your requirement, create a measure using DAX as below:

Max Time = CALCULATE(MAX(Table1[Time]), FILTER(ALLEXCEPT(Table1, Table1[Category]), Table1[Date] = MAX(Table1[Date]) && Table1[Time] = MAX(Table1[Time])))

捕获.PNG  

 

Regards,

Jimmy Tao

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.