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
Serdet
Post Patron
Post Patron

Showing the latest value

Hi All,

 

I have a table that looks like the following;

DateTotal Amount Owed
01/01/2020£1,000.00
01/02/2020£2,000.00
01/03/2020£8,000.00
01/04/2020£6,000.00
01/05/2020£8,000.00

 

I am creating a report that shows the current total amount owed amount. How can I show this because when I drop the 'Total Amount Owed' column into a card it adds all of these values together instead of showing me the latest £8,000 figure.

Cheers, 

E

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

6 REPLIES 6
amitchandak
Super User
Super User

@Serdet , try lastnonblankvalue

lastnonblankvalue(Table[Date], max(Table[Total Amount Owed]))

https://docs.microsoft.com/en-us/dax/lastnonblankvalue-function-dax

Hi @amitchandak 

How do you pull back the actual date that the latest value was made on? 
I only want to show the latest value, if I "dont summerise" the date it brings back all the values, If I say Min will bring the min date on all the table values (01/04/2020) and if MAX the max date on all values ("Today")? 
Any ideas?

eg Table: 

Provider Comment Date 
AComment 1   01/07/2020
A    03/07/2020
AComment 2   22/07/2020
A    31/07/2020
BComment 1   01/05/2020
BComment 2    01/06/2020
B    28/06/2020
BComment 3   12/07/2020
B    22/07/2020

 

Pulls back 

Provider Comment Date
AComment 2   22/07/2020
BComment 3   12/07/2020
az38
Community Champion
Community Champion

Hi @Serdet 

try to create a measure and put it into card visual

Measure = 
var _lastDate = CALCULATE(MAX(Table[Date]))
RETURN
CALCULATE(MAX(Table[Total Amount]), Table[Date] = _lastDate )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi,

 

I have entered the following and have received an error message (the sytax is incorrect)

 

Current WIP =
var _lastDate = CALCULATE(MAX('Cape Coms'[Date]))
RETURN
CALCULATE(MAX('Cape Coms'[Total WIP (£)]), 'Cape Coms'[Date] = LASTDATE)

Please note the above-mentioned columns are my actual column names.

Please can you help?
 
 
az38
Community Champion
Community Champion

@Serdet 

of course it is incorrect by syntax, please, pay attention closely to my statement.

replace your LASTDATE to variable name _lastDate


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
mahoneypat
Employee
Employee

You can use a measure like this to get the latest value

 

Latest Amt Owed =
VAR latestdate =
MAX ( Table[Date] )
RETURN
CALCULATE ( MAX ( Table[Total Amount Owed] ), Table[Date] = latestdate )

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.