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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
EstherBR
Frequent Visitor

Card showing last value added to a table

Hi,

 

I have the following table. I would like to create a card that shows the last sales value added to the table. In this case, the card should show 135. How can I create achieve this? Thank you so much!

 

EstherBR_0-1725871001317.png

 

1 ACCEPTED SOLUTION
v-jtian-msft
Community Support
Community Support

Hello,bhanu_gautam ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.


Hi,@EstherBR .I am glad to help you.
If your real data is as per the test data you have provided and the Date column is registered in chronological order, i.e. the date of the next rank will always be greater than the date above it (i.e. chronological rank)
Then you can refer to my test below.

vjtianmsft_0-1725948532458.png

Last_notblankSales = 
VAR _maxDate =
    CALCULATE (
        MAX ( 'Sheet2'[Date] ),
        FILTER ( ALL ( Sheet2 ), NOT ( ISBLANK ( 'Sheet2'[Sales] ) ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Sheet2'[Sales] ),
        FILTER ( ALL ( Sheet2 ), 'Sheet2'[Date] = _maxDate )
    )


Here is my test data:

vjtianmsft_1-1725948584925.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jtian-msft
Community Support
Community Support

Hello,bhanu_gautam ,thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.


Hi,@EstherBR .I am glad to help you.
If your real data is as per the test data you have provided and the Date column is registered in chronological order, i.e. the date of the next rank will always be greater than the date above it (i.e. chronological rank)
Then you can refer to my test below.

vjtianmsft_0-1725948532458.png

Last_notblankSales = 
VAR _maxDate =
    CALCULATE (
        MAX ( 'Sheet2'[Date] ),
        FILTER ( ALL ( Sheet2 ), NOT ( ISBLANK ( 'Sheet2'[Sales] ) ) )
    )
RETURN
    CALCULATE (
        MAX ( 'Sheet2'[Sales] ),
        FILTER ( ALL ( Sheet2 ), 'Sheet2'[Date] = _maxDate )
    )


Here is my test data:

vjtianmsft_1-1725948584925.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@EstherBR , You can create a measure 

 

 Last Sales Value =
     LASTNONBLANK('YourTableName'[Sales], CALCULATE(MAX('YourTableName'[Sales])))
 
Go to the "Visualizations" pane.
Select the "Card" visualization.
Drag the newly created measure (Last Sales Value) to the "Values" field of the Card.



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

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.