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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Alice_Cooper
Helper II
Helper II

How to return value of a field based on Latest Record Date

Hi Guys,

I have come across a problem and would really like some help.

I have data set HLPropertyDataEntry three fields are in question here. EndOfMonthReportPeriod, TotalProperties and TotalActiveProperties .... The visualisation is not filtered. The visualisation returns data from two other datasets that contain only one record (HLPartyDataEntry and HLFundingDataEntry). The values for these in the snippet below are 100, 85 and the $1,475,629 ... These are OK.

 

The Datatset HLPropertyDataEntry is the problem... I want to display a Card that gives me the Latest values of TotalProperties and TotalActiveLeases based on EndOfMonthReportPeriod.

 

The data is as per the Matrix where September 2023 should have 32 as Total Properties and 25 as TotalActiveLeases ... When using the Card Viz for TotalActiveLeases I cannot get the latest record ... using Max returns 28 ... Can someone help me please?

 

Here is teh data:

 

YearMonthTotal PropertiesTotal Active Leases
2022July33
2022August55
2022September88
2022November1010
2023January1312
2023February1514
2023March1918
2023April2120
2023May2423
2023June2624
2023July2926
2023August3128
2023September3225

 

 

Alice_Cooper_0-1669071449938.png

 

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Alice_Cooper Assuming you have a Date column, try:

Measure = 
  VAR __Date = MAXX(ALL('Table'),[Date])
  VAR __MaxValue = MAXX(FILTER(ALL('Table'),[Date] = __Date),[Total Active Leases])
RETURN 
  __MaxValue


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Alice_Cooper
Helper II
Helper II

Fantastic.... I am very appreciative... Have been working on this for days ... Works a treat .... You are a Legand.... 

Greg_Deckler
Super User
Super User

@Alice_Cooper Assuming you have a Date column, try:

Measure = 
  VAR __Date = MAXX(ALL('Table'),[Date])
  VAR __MaxValue = MAXX(FILTER(ALL('Table'),[Date] = __Date),[Total Active Leases])
RETURN 
  __MaxValue


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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