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
HR30385
Regular Visitor

Retrieve Max of Measure (PBI example file included)

Hi, 

 

I need to retrieve the max value for my measure (revenue_cost_ratio) depending on what is shown in my table. The filter context must be used to retrieve the max value. Here is the example:

 

Here my max measure for revenue_cost_ratio should return 239%:

HR30385_2-1725883004747.png

 


When filtered for "Summer" my max measure should return 184%:

HR30385_1-1725882987692.png

 

 

Here is the power bi file: https://easyupload.io/w2824z

 

Any help is greatly appreciated!

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Max revenue_cost_ratio = 
MAXX(
    SUMMARIZE( fact_sales, dim_manufacturer[Manufacturer], dim_category[category] ),
    [revenue_cost_ratio]
)

ThxAlot_0-1725885758868.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

Max revenue_cost_ratio = 
MAXX(
    SUMMARIZE( fact_sales, dim_manufacturer[Manufacturer], dim_category[category] ),
    [revenue_cost_ratio]
)

ThxAlot_0-1725885758868.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Selva-Salimi
Responsive Resident
Responsive Resident

Hi @HR30385 

 

you can write a measure as follows:

 

measure max_percent := var tbl1= summarize (table, [category], [manufacturer] ,'rev' ,[(revenue_cost_ratio])

return maxx(tbl1, rev)

 

If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly. 

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.