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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

MINX of Measure not behaving as expected

I have a slicer to select a Country, and a table with 3 measures based on this slicer. The three measures are: Average Historical ASP, Average Material Cost, and Margin. I am trying to add a 4th measure which finds the minimum value from all values in the Margin column.

 

The formula I am currently using is: 

Min Margin = MINX('Historical ASP', [Margin])

 

colsen12_0-1674774023842.png

 

I would expect that with all Country values selected, it should show 3.27 as Min Margin for all rows in the above. Where am I going wrong? 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

Min Margin = 
  VAR __Table = SUMMARIZE(ALL('Historical ASP'),[Country],"__Margin",[Margin])
  VAR __Result = MINX(__Table,[__Margin])
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

hi @Anonymous 

Seems on the wrong granularity,  try like:

Min Margin =
MINX(
    SUMMARIZE(
        'Historical ASP', 
        'Historical ASP'[Country], 
        'Historical ASP'[PH7]
    ),
    [Margin]
)
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

Min Margin = 
  VAR __Table = SUMMARIZE(ALL('Historical ASP'),[Country],"__Margin",[Margin])
  VAR __Result = MINX(__Table,[__Margin])
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Thanks that works. Was wondering, if I wanted to measure MINX only for selected Country fields from the slicer, where do I add that in? 

Try ALLSELECTED instead of ALL.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.