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
shareezsaleem
Helper III
Helper III

Get the latest & most repeated Unit Prices

Hi All, I am looking to extract latest value and most repeated value (if tie get max).

 

Item UOM Unit Price Order Date
Item1 EA 95.00 25-Jan-22
Item1 Carton 1,800.00 24-Feb-22
Item1 EA 95.00 19-Feb-22
Item1 EA 80.00 1-Mar-22

 

Result should be like this:

Item UOM Latest Unit Price Most Repeated
Item1 EA 80 95

 

Looking for dax meaure not calculated column measure.

1 ACCEPTED SOLUTION
ddpl
Solution Sage
Solution Sage

@shareezsaleem try by creating below Measures

UOM  = var T1 = SUMMARIZE('Table','Table'[UOM],"Count",COUNTROWS('Table'))
       var T2 = MAXX(T1,[Count])
     return
       MAXX( T1, IF([Count] = T2,'Table'[UOM])) 
 
Latest Unit Price = var _M = MAXX('Table','Table'[Order Date])
                       return
                       CALCULATE(MAX('Table'[Unit Price]),'Table'[Order Date] = _M)
 
Most Repeated = var T1 = SUMMARIZE('Table','Table'[Unit Price],"Count",COUNTROWS('Table'))
            var T2 = MAXX(T1,[Count])
             return
MAXX( T1, IF([Count] = T2,'Table'[Unit Price]))
 

View solution in original post

1 REPLY 1
ddpl
Solution Sage
Solution Sage

@shareezsaleem try by creating below Measures

UOM  = var T1 = SUMMARIZE('Table','Table'[UOM],"Count",COUNTROWS('Table'))
       var T2 = MAXX(T1,[Count])
     return
       MAXX( T1, IF([Count] = T2,'Table'[UOM])) 
 
Latest Unit Price = var _M = MAXX('Table','Table'[Order Date])
                       return
                       CALCULATE(MAX('Table'[Unit Price]),'Table'[Order Date] = _M)
 
Most Repeated = var T1 = SUMMARIZE('Table','Table'[Unit Price],"Count",COUNTROWS('Table'))
            var T2 = MAXX(T1,[Count])
             return
MAXX( T1, IF([Count] = T2,'Table'[Unit Price]))
 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Kudoed Authors