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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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