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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mic_rys
Helper I
Helper I

last value for client

hi, i have a little issue, i need to choose always last value by client. examples:

ClientUserDateValue
client1us102.02.202010,4
client1us102.02.20202
client1us201.04.20203
client2us301.08.20201,2
client2us301.10.20206
client3us401.11.202015,2


I have date tale too with, year,quarter, month, day

 

Could you help me to create a measure which shows always last value. Nice to work with date dimensions;

1. only client - value by client from last date

.2 client, year- value by client,year from last date

3. client, year, month - value by client,year,month from last date

 

i tried:


measure =
var datelast= CALCULATE(LASTNONBLANK([Date],TRUE()))

return
CALCULATE(sum(value),FILTER(date table, date = datelast))

 

but something is not good;/

thanks !

 

1 REPLY 1
amitchandak
Super User
Super User

@mic_rys ,Output is not clear, Suggesting few measure. In case you need group year month , add that in date table

Create a calendar Table .

Date = calendar(min(Table[Date]), Max(Table[Date]) )

 

Join it date of you table

 

Try measure like

 

measure last date =
var datelast= CALCULATE(LASTNONBLANK(Table[Date],TRUE())) //or use maxx(Allselected(Table), Table[Date])

return
CALCULATE(sum(value),FILTER(Date, Date[Date] = datelast))

 

measure this year =
var datelast= CALCULATE(LASTNONBLANK(Table[Date],TRUE())) //or use maxx(Allselected(Table), Table[Date])
var _min = date(year(datelast),1,)
return
CALCULATE(sum(value),FILTER(Date, Date[Date] <= datelast && Date[Date] >= _min))


measure this month =
var datelast= CALCULATE(LASTNONBLANK(Table[Date],TRUE())) //or use maxx(Allselected(Table), Table[Date])
var _min = eomonth( datelast,-1)+1
return
CALCULATE(sum(value),FILTER(Date, Date[Date] <= datelast && Date[Date] >= _min))

 

 

Refer why TI fails, to check what end date of calendar will do - https://www.youtube.com/watch?v=OBf0rjpp5Hw

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0
Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

Day Intelligence - Last day, last non continous day
https://medium.com/@amitchandak.1978/power-bi-day-intelligence-questions-time-intelligence-5-5-5c324...

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.