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
ngct1112
Post Patron
Post Patron

New measure according by Rank(DAX)

Hi,

 

I am struggling on creating a table which I hope I could seek some helps here. I have upload my BI Sample here.

In my simpified model, I have 2 measures:

1,) Price_FX

2.) 

 

Rank(Measure) = 
RANKX(
    FILTER(
        ALLSELECTED('Table'[ID],'Table'[Supplier]),
        'Table'[ID] = MAX('Table'[ID])),
        [Price_FX(measure)],,ASC)

 

With my Original Data:

ProjectIDSupplierPrice(measure)
BI-20211D15.6
BI-20211B31.2
BI-20211C62.4
BI-20211A15.6
BI-20212A93.6
BI-20212B46.8
BI-20212C39

I am hoping I could create a table like the below.





ngct1112_1-1626770284801.png

 

Appreciated if I could help some helps!

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ngct1112 , create a table using generate series

 

Bucket = generateseries(1,4,1)

 

measure =

var _tab = addcolumns(summarize('Table','Table'[ID],'Table'[Supplier]), "Rank",[Rank(Measure)], "_1",[[Price_FX(measure)])
return
maxx(filter(_tab, [Rank] = max(bucket[Value])),[_1])

 

Take max for supplier, or create a measure like above. Use bucket value in column in matrix

View solution in original post

2 REPLIES 2
ngct1112
Post Patron
Post Patron

@amitchandak Thanks for your help again!

amitchandak
Super User
Super User

@ngct1112 , create a table using generate series

 

Bucket = generateseries(1,4,1)

 

measure =

var _tab = addcolumns(summarize('Table','Table'[ID],'Table'[Supplier]), "Rank",[Rank(Measure)], "_1",[[Price_FX(measure)])
return
maxx(filter(_tab, [Rank] = max(bucket[Value])),[_1])

 

Take max for supplier, or create a measure like above. Use bucket value in column in matrix

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.