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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Vtomsons
Helper I
Helper I

MAX Function only accepts a column reference as an argument

Hi,

 

I have used this equation before but this time I can't get rid of the error(MAX Function only accepts a column reference as an argument). Does anyone see why I am getti ng the error?

 

Last No Extension Date Qty =
    var _max = MAXX(FILTER(ALLSELECTED('Combined Reg''n'), 'Combined Reg''n'[Student ID] = MAX('Combined Reg''n'[Student ID])), 'Combined Reg''n'[Registration start date])
    return CALCULATE(SUM('Combined Reg''n'[No Extension Revenue]),FILTER('Combined Reg''n','Combined Reg''n'[Student ID]=MAX('Combined Reg''n'[Student ID] && 'Combined Reg''n'[Registration start date] = _max)))
1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Vtomsons

 try like:

Last No Extension Date Qty =
var _max = 
MAXX(
    FILTER(
        ALLSELECTED('Combined Reg''n'), 
        'Combined Reg''n'[Student ID] = MAX('Combined Reg''n'[Student ID])
    ), 
    'Combined Reg''n'[Registration start date]
)
return 
CALCULATE(
    SUM('Combined Reg''n'[No Extension Revenue]),
    FILTER(
        'Combined Reg''n',
        'Combined Reg''n'[Student ID]=MAX('Combined Reg''n'[Student ID]
            && 'Combined Reg''n'[Registration start date] = _max
    )
)

 

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

hi @Vtomsons

 try like:

Last No Extension Date Qty =
var _max = 
MAXX(
    FILTER(
        ALLSELECTED('Combined Reg''n'), 
        'Combined Reg''n'[Student ID] = MAX('Combined Reg''n'[Student ID])
    ), 
    'Combined Reg''n'[Registration start date]
)
return 
CALCULATE(
    SUM('Combined Reg''n'[No Extension Revenue]),
    FILTER(
        'Combined Reg''n',
        'Combined Reg''n'[Student ID]=MAX('Combined Reg''n'[Student ID]
            && 'Combined Reg''n'[Registration start date] = _max
    )
)

 

Perfect. It worked!

 

Thanks!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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