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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Show latest value on card

vyadongfmsft_10-1665564649075.png

vyadongfmsft_11-1665564666166.png

I have the following chart, with a card above the chart that shows average of total sick days and latest value.

 

The way my data model is that I have a table called Sales with columns like Month, Month/Year in format mmmm-yyyy, and Sick Leave. 

 

vyadongfmsft_9-1665564580557.png

Latest value = CALCULATE(AVERAGE('Table'[Sick leave]),FILTER('Table',MONTH('Table'[Month/Year]) = MONTH(TODAY()))) 

Average of sick leave = AVERAGE('Table'[Sick leave])

 

However what this does is that if the current month is October, the latest value will show as blank if the October data is not available. Sometimes the data is not received until 2nd week of month and I don't want the card showing blank, for example if october data is not ready, rather than showing blank I want it showing september value until october value has been added. Is it possible? 

 

Also when selecting other columns, is it possible to keep the latest value card as not blank?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@lukiz84 

Thank you, yep it worked, solution below 

 

Latest value =
VAR maxMonthTable =
CALCULATE(
MONTH(MAX('Table'[MONTH/YEAR])),
ALL('Table')
)

RETURN CALCULATE (
AVERAGE ( 'Table'[SICK LEAVE TOTAL DAYS]),
FILTER ( ALL('Table'), MONTH ( 'Table'[MONTH/YEAR]) = maxMonthTable)
)

View solution in original post

9 REPLIES 9
lukiz84
Memorable Member
Memorable Member

Hi,

 

Latest value =
VAR maxMonthTable =
   MONTH(MAX('Table'[Month/Year]))


RETURN CALCULATE (
    AVERAGE ( 'Table'[Sick leave] ),
    FILTER ( 'Table', MONTH ( 'Table'[Month/Year] ) = maxMonthTable )
)



               
Anonymous
Not applicable

@lukiz84 Thank you! Is it possible for when selecting different months, the latest value remains the same as it is. For example when picking July and August, I want the latest available data (which in this case is September) to show up instead of August value. 

 

 

TikkiMasala_0-1665703210930.png

TikkiMasala_1-1665703574921.png

 

 

Hi,

 

sure, sorry:

 

Latest value =
VAR maxMonthTable =
   CALCULATE(
      MONTH(MAX('Table'[Month/Year])),
      ALL('Table')
   )

RETURN CALCULATE (
    AVERAGE ( 'Table'[Sick leave] ),
    FILTER ( 'Table', MONTH ( 'Table'[Month/Year] ) = maxMonthTable )
)

 

or if you have a date table in place (i'm not sure if you do):

 

Latest value =
VAR maxMonthTable =
   CALCULATE(
      MONTH(MAX('Table'[Month/Year])),
      ALL('Dates')
   )

RETURN CALCULATE (
    AVERAGE ( 'Table'[Sick leave] ),
    FILTER ( 'Table', MONTH ( 'Table'[Month/Year] ) = maxMonthTable )
)
Anonymous
Not applicable

@lukiz84 

Sorry does not work, shows up as blank now 

 

TikkiMasala_0-1665716588421.png

TikkiMasala_1-1665716613036.png

 

 

Do you have a date table in place?

 

but try

 

Latest value =
VAR maxMonthTable =
   CALCULATE(
      MONTH(MAX('Table'[Month/Year])),
      ALL('Table[Month/Year]')
   )

RETURN CALCULATE (
    AVERAGE ( 'Table'[Sick leave] ),
    FILTER ( ALL('Table'), MONTH ( 'Table'[Month/Year] ) = maxMonthTable )
)
Anonymous
Not applicable

@lukiz84 

 

Do not have date table in place 

ok did you try my latest measure?

Anonymous
Not applicable

@lukiz84 

Thank you, yep it worked, solution below 

 

Latest value =
VAR maxMonthTable =
CALCULATE(
MONTH(MAX('Table'[MONTH/YEAR])),
ALL('Table')
)

RETURN CALCULATE (
AVERAGE ( 'Table'[SICK LEAVE TOTAL DAYS]),
FILTER ( ALL('Table'), MONTH ( 'Table'[MONTH/YEAR]) = maxMonthTable)
)

fine, please mark my answer as solution 😉

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.