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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
PshemekFLK
Helper IV
Helper IV

Can't get to the right MAX

I have this table:

 

PshemekFLK_0-1666884141516.png

And would like to achieve a simple MAX column:

 

PshemekFLK_0-1666884624397.png

 

 

I'm trying this measure but it doesn't work:

 

MAXX(ALL(dim_calendar[Activity Mo Name]), [Ratio])

 

Can you guide me towards the right solution?

 

 

 

 

 

1 ACCEPTED SOLUTION
besomebody20
Resolver I
Resolver I

Please try this measure:

CALCULATE(
MAXX(
ADDCOLUMNS(
SUMMARIZE(
'dim_calendar',
'dim_calendar'[Activity Mo Name]
),
"_ratio", [Ratio]
),
[_ratio]
),
ALLSELECTED('dim_calendar')
)

 The ADDCOLUMNS and SUMMARIZE functions create the table for MAXX to iterate over to find the max ratio. The ALLSELECTED function will clear the filter context on the row of the table visual to give you the max ratio of all rows.

View solution in original post

13 REPLIES 13
besomebody20
Resolver I
Resolver I

Please try this measure:

CALCULATE(
MAXX(
ADDCOLUMNS(
SUMMARIZE(
'dim_calendar',
'dim_calendar'[Activity Mo Name]
),
"_ratio", [Ratio]
),
[_ratio]
),
ALLSELECTED('dim_calendar')
)

 The ADDCOLUMNS and SUMMARIZE functions create the table for MAXX to iterate over to find the max ratio. The ALLSELECTED function will clear the filter context on the row of the table visual to give you the max ratio of all rows.

@besomebody20 , Thank you so much for this! Works perfectly! I was pulling my hair out the whole day over this!

 

Anonymous
Not applicable

Hello can you please try:

 

 

MAXX(ALL(Dim_calendar), [ratio])

 

 


dim date:
 

dimdate.png

created sample of your data: 

 

Screenshot 2022-10-28 000821.png

result:

Screenshot 2022-10-28 000829.png

 

 

 

 

tamerj1
Super User
Super User

@PshemekFLK 

Please try

=
MAXX (
    CALCULATETABLE (
        VALUES ( dim_calendar[Activity Mo Name] ),
        REMOVEFILTERS ( dim_calendar )
    ),
    [Ratio]
)

@tamerj1  Also didn't work. Exact same result as last time... 

@PshemekFLK 

I'm sure we don't have to complete picture. Please try

=
MAXX ( KEEPFILTERS ( ALL ( dim_calendar[Activity Mo Name] ) ), [Ratio] )

@tamerj1  again same result...

 

I also thought there must be something else blocking but just checked for a thrid time:

 

no filters applied to the table

[Ratio] = DIVIDE([Measure 1],[Measure 2])

[Measure 1] = DIVIDE(SUM(fct_bookings[Column 1]),1000)

[Measure 2] = DIVIDE(SUM(fct_bookings[Column 2]),1000)

dim_calendar is properly connected to fct_bookings with "one to many" relation

 

What else can be stopping the MAXX measure from working properly?

@PshemekFLK 

Perhaps you are using the wrong column in the visual. Perhaps other columns are also present in the same visual 

@tamerj1 Checked all the above. Only dim_calendar{Activity Mo Name], [Ratio] and [Max} in the table...

tamerj1
Super User
Super User

Hi @PshemekFLK 

what result are getting? Are you filtering a certain year?

Greg_Deckler
Community Champion
Community Champion

@PshemekFLK If Ratio is a measure, maybe: 

Max Measure =
  VAR __Table = ADDCOLUMNS(DISTINCT(ALL(dim_calendar[Activity Mo Name])),"__Ratio",[Ratio])
RETURN
  MAXX(__Table, [__Ratio])


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...

@Greg_Deckler

Unfortunately doesn't work. I'm getting same result with yours and mine formula which is just replication of Ratio column. It's like I can't remove the filter from "Activity Mo Name" no matter what I try.

 

@tamerj1 , @Greg_Deckler   the result:

 

PshemekFLK_0-1666897573019.png

 

 

 

 

@tamerj1 I'm not filtering on a year, no filters on that table

 

[Ratio] measure is a simple divide or SUMX over fact tables. I really don't get why it doesn't work

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.