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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
kristir2010
Regular Visitor

Using MAXX and filter with dates from date slicer

I want the max value of a category. Which I have done successfully by using this

Max =

var fid = Table[category]

return

    CALCULATE(

        MAXX(

            FILTER(Table, Table[category] = fid),

            Table[Value]

        )

    )

 

But I want to be able to compare the dates in my table to the current selected dates from my slicer. As in, I only want Max to be the maximum value within the date range I have. How can I differentiate the current row's date from the min and max date slicer selection? I keep getting circular dependency errors.

 

DateCategoryValue*What I want Max to be*
12/12/2022franchise100
01/04/2022franchise100
01/01/2017franchise140
03/09/2022franchise203
10/08/2022franchise233
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kristir2010 ,

 

You can try this code to create a calculated column.

Value in Max Date each Category =
VAR _MAXDATE =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Date] = _MAXDATE )
    )

Result is as below.

RicoZhou_0-1675235823856.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @kristir2010 ,

 

You can try this code to create a calculated column.

Value in Max Date each Category =
VAR _MAXDATE =
    CALCULATE ( MAX ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[Category] ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Date] = _MAXDATE )
    )

Result is as below.

RicoZhou_0-1675235823856.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.