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
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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.