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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX/Calculated Column: Select latest records

Hi Team,

 

Looking for help trying to display the latest set of numbers based on a field that has 3 values - for simplicity, we'll call them First, Second, Final. I need my measure (or calculated column) to select the Final set of numbers, if it doesn't exist the Second, and at worst, the First.  It seems like an If/Else statement - but I can't figure out how to make this one work.

 

First, I created a new column (Settlement Type Number) where my 'First', 'Second', and 'Final' were converted to numbers: 1, 2, 3.

 

Site Desc = the Site Name corresponding to that set of data.

 

New Measure = if(CALCULATE(MAX(TABLE_NAME[Settlement Type Number]),

FILTER(TABLE_NAME, TABLE_NAME[SITE_DESC]=EARLIER(TABLE_NAME[SITE_DESC])))= TABLE_NAME[Settlement Type Number],1,0)
 
This worked for an Microsoft tech helping me out when I gave him a set of data, but it won't work for my table... not sure why.
 
Please help!

 

 

 

1 REPLY 1
GilbertQ
Super User
Super User

Hi there

Do you have a sample dataset that you can put into this message?

And what what the expected output should be?




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

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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