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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

How to show the latest value in card in powerbi

 

I have the following chart which shows sick leave per person for July and August and on top of that is a card that shows the average of all the months, so in this case is average of July and August which gives 1.55.

 

The table name is sick leave and my date column is called month/year and is in the format mmm-yy in the same table. 

TikkiMasala_1-1664499391727.png

Instead of the average, I want the card to show the latest value of the month, so in this case I want the card to show August value which is 0.79 and when September data is loaded, I want the card to show September data instead, unless someone clicks on a different month, then the card should update to show average of what they selected.

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @Anonymous,

The solution below assumes  that you dont have a separate dates table.

Create a calculated column of periods using DAX

 

PERIOD = 
FORMAT ( 'DataTable'[Date], "YYYYMM" )​Creat this measureCreate this measure

 

Create this measure below

 

Value of the latest month = 
VAR __maxperiod =
    CALCULATE ( MAX ( 'DataTable'[YYYYMM] ), ALL ( 'DataTable' ) )
RETURN
    CALCULATE (
        [Sum of Values],
        FILTER ( ALL ( 'DataTable' ), 'DataTable'[YYYYMM] = __maxperiod )
    )

 

sample result

danextian_3-1664501678195.png





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

The table name is sick leave and my date column is called month/year and is in the format mmm-yy in the same table. 

amitchandak
Super User
Super User

@Anonymous , You can try a measure like, Assume your table name is sales and net is the measure I used

 

This Month =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , Maxx(allselected(Sales), Sales[Date])),0)
var _min = eomonth(_max,-1)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

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
Anonymous
Not applicable

The table name is sick leave and my date column is called month/year and is in the format mmm-yy in the same table

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors