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
patroriki
Frequent Visitor

FIND LATEST CLASSIFICATION OF RETAILER BASED ON LATEST DATE

Dear All

 

Request you to help in DAX to find latest retailer UID classification based on its latest date.

 

Retailer UIDRetailer ClassMonthUpdated Retailer ClassRemarks
AP-0000001C01-05-2022DBased on latest month(Ex. 01-08-2022)
AP-0000001D01-06-2022DBased on latest month(Ex. 01-08-2022)
AP-0000001D01-08-2022DBased on latest month(Ex. 01-08-2022)
AP-0000003C01-05-2022D 
AP-0000003D01-06-2022D 
AP-0000004C01-05-2022B 
AP-0000004B01-06-2022B 
AP-0000005D01-05-2022A 
AP-0000005D01-06-2022A 
AP-0000005A01-07-2022A 
AP-0000006C01-05-2022D 
AP-0000006D01-06-2022D 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @patroriki 

 

You can try the following methods.

Measure:

Latest date UID = 
CALCULATE (
    MAX ( 'Table'[Retailer UID] ),
    FILTER (
        ALL ( 'Table' ),
        [Month] = CALCULATE ( MAX ( 'Table'[Month] ), ALL ( 'Table' ) )
    )
)

vzhangti_0-1657767524765.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @patroriki 

 

You can try the following methods.

Measure:

Latest date UID = 
CALCULATE (
    MAX ( 'Table'[Retailer UID] ),
    FILTER (
        ALL ( 'Table' ),
        [Month] = CALCULATE ( MAX ( 'Table'[Month] ), ALL ( 'Table' ) )
    )
)

vzhangti_0-1657767524765.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

=coalesce(

LOOKUPVALUE(Data[Retailer Class],Data[Month],CALCULATE(MAX(Data[Month]),FILTER(Data,Data[Retailer UID]=EARLIER(Data[Retailer UID])&&Data[Month]>EARLIER(Data[Month]))),Data[Retailer UID],Data[Retailer UID]),Data[Retailer Class])

Hope this helps.


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

@patroriki , Try a new column like

 


New column =
var _max = maxx(filter(Table, [Retailer UID] = earlier([Retailer UID]) ), [Month])
return
maxx(filter(Table, [Retailer UID] = earlier([Retailer UID]) && [Month] =_max),[Updated Retailer Class])

 

or

 


New column =
var _max = maxx(filter(Table, [Retailer UID] = earlier([Retailer UID]) ), [Month])
return
maxx(filter(Table, [Retailer UID] = earlier([Retailer UID]) && [Month] =_max),[Retailer Class])

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.

Top Solution Authors