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
jamienourish
Frequent Visitor

Getting last value as a measure based on latest date

I have the following data i am sending using the api, so I can not create new columns only measures

user_id State Update

1OFF05/30/18 03:27:32 PM
2ON05/30/18 03:28:32 PM
1ON05/30/18 03:30:32 PM
2OFF05/30/18 03:34:32 PM

 

I would like to display in a visual the latest state of users so it will look something like this

 

user_id State Update

1ON05/30/18 03:30:32 PM
2OFF05/30/18 03:34:32 PM

 

I have tried something like 

 

CalcColumn =
CALCULATE(LASTDATE(user[update])
,
ALLEXCEPT ( user, user[user_id])
)

 

however LASTDATE is seeing the dateTime as duplicates

 

Please help

3 REPLIES 3
v-yuta-msft
Community Support
Community Support

Hi jamienourish,

 

What does "LASTDATE is seeing the dateTime as duplicates" mean? What's your expected requirement?

 

Regards,

Jimmy Tao

alexei7
Continued Contributor
Continued Contributor

Hi,

 

I think you can create a summary table with the value that you want in it.

Try using this and replacing the table name and column names with your own:

 

Table = FILTER(Table1, Table1[update]=CALCULATE(max(Table1[update]),ALLEXCEPT(Table1,Table1[user_id])))

Thanks for the reply unfortunatly i get 

 

Error Message:
Query (8, 5) Calculation error in measure 'user'[Table]: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value

 

I can only do this as a measure as i am using a dataset created using the api

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.