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
Varun511
Helper I
Helper I

Max Vaue for each month and Sum up based on date slicer

HI ,

 

Have below data  need to find out Max Actual Trans for each month and Sumup and i do have date slicer in the report

 

for suppose if select date slicer from March 1st till Apr 30th need to find max Actual trans for March and April and then sumup and show in report 

 

tried Maxx(table1,Actual trans) but not wokring can anyone help me this issue?

 

Any help would be highly appreciated 

 

Varun511_0-1652785885336.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Varun511 ,

 

I found that you have multiple same dates with different Actual Trans, supposing that the max value you want to return is whether grouped by date returns the max value monthly.

Below is my solution for two situations.

Sample data

vstephenmsft_0-1653031984637.png

Create a calendar table.

Calendar =
ADDCOLUMNS (
    CALENDAR ( MIN ( 'Table'[Trans Date] ), MAX ( 'Table'[Trans Date] ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] )
)

vstephenmsft_2-1653032052148.png

vstephenmsft_1-1653032033473.png

 

If you want to return the max value grouped by date for each month,

create a measure to get the sum grouped by date.

Sum per month =
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        [Month] = MAX ( 'Calendar'[Month] )
            && [Year] = MAX ( 'Calendar'[Year] )
    )
)

Then create another measure to get the max value for each month.

Max Actual Trans for each month1 =
MAXX (
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        [Month] = MAX ( 'Calendar'[Month] )
            && [Year] = MAX ( 'Calendar'[Year] )
    ),
    [Sum grouped by date]
)

vstephenmsft_6-1653033627709.png

Sum up measure is as follows.

SumUp = CALCULATE(SUM('Table'[Value]),ALLSELECTED('Calendar'))

vstephenmsft_8-1653033968143.png

 

 

 

 

Best Regards,

Stephen Tao

 

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

9 REPLIES 9
Anonymous
Not applicable

Hi @Varun511 ,

 

I found that you have multiple same dates with different Actual Trans, supposing that the max value you want to return is whether grouped by date returns the max value monthly.

Below is my solution for two situations.

Sample data

vstephenmsft_0-1653031984637.png

Create a calendar table.

Calendar =
ADDCOLUMNS (
    CALENDAR ( MIN ( 'Table'[Trans Date] ), MAX ( 'Table'[Trans Date] ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] )
)

vstephenmsft_2-1653032052148.png

vstephenmsft_1-1653032033473.png

 

If you want to return the max value grouped by date for each month,

create a measure to get the sum grouped by date.

Sum per month =
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        [Month] = MAX ( 'Calendar'[Month] )
            && [Year] = MAX ( 'Calendar'[Year] )
    )
)

Then create another measure to get the max value for each month.

Max Actual Trans for each month1 =
MAXX (
    FILTER (
        ALLSELECTED ( 'Calendar' ),
        [Month] = MAX ( 'Calendar'[Month] )
            && [Year] = MAX ( 'Calendar'[Year] )
    ),
    [Sum grouped by date]
)

vstephenmsft_6-1653033627709.png

Sum up measure is as follows.

SumUp = CALCULATE(SUM('Table'[Value]),ALLSELECTED('Calendar'))

vstephenmsft_8-1653033968143.png

 

 

 

 

Best Regards,

Stephen Tao

 

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

 

 

rohit_singh
Solution Sage
Solution Sage

Hi @Varun511 ,

I have assumed the following to be my dataset

rohit_singh_1-1652787260183.png

I have created a measure 

Max Trans = Maxx(ProcessTrans, ProcessTrans[Actual Trans])
 
which changes the max values correctly when using the slicer

rohit_singh_0-1652787209153.png

What is the output that you're getting?

Kind regards

Rohit

Rohit need to Sumup  both and show  in one line 650+630

and also rohit i do have date table and am joining with main table

Hi @Varun511 ,

Not sure if this is exactly as per your requirement but it does calculate the sum of max values per month

rohit_singh_0-1652790833577.png

Sum Trans =

var _mindate = min(ProcessTrans[Trans Date])

var _maxdate = max(ProcessTrans[Trans Date])

var _minmonth = min(ProcessTrans[Start of Month])

var _maxmonth = max(ProcessTrans[Start of Month])

var _minsum = CALCULATE([Max Trans], FILTER(ALLSELECTED(ProcessTrans), ProcessTrans[Start of Month] = _minmonth))

var _maxsum = CALCULATE([Max Trans], FILTER(ALLSELECTED(ProcessTrans), ProcessTrans[Start of Month] = _maxmonth))

RETURN
_minsum + _maxsum
 

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

Rohit i have date table am using date from date slicer will this logic work? 

Hi @Varun511 ,

Yes it does work for me when I filter using a date table instead of the trans date column.

rohit_singh_0-1652793217763.png

Please ensure that you have joined trans date on the main table with the date field on the date table.

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 😊

 

Anonymous
Not applicable

Hi Carun511

 

Do you have a Date table ?

HI James,

 

Sorry forget to mention yes i do have data table and joining to main table

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors