Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.