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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Calculate minimum value over Last 12 Months

Hi Experts,

 

I need to find out the Minimum amount over last 12 Months, below is my sample data. 

Expected output should be : 25.10 which is in Month 5. 

Month Amount
1102.00
2110.05
350.05
430.00
525.10
670.00
790.00
8110.00
945.00
1065.00
1185.00
12120.00

 

I have tried below dax : 

MINX(VALUES('Date'[Month]), [Amount])
However, this dax giving me result as 0.00 everytime. 
 
Thanks in Advance.

 

 

1 ACCEPTED SOLUTION
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

you can't reference a measure in a Min formula. Therefore you have to recalculate you sumamount in your new min-measure using some Summarize and addcolum. Here the solution that should work for you

MinOfSumAmount = calculate(
    minx(
        ADDCOLUMNS(
            SUMMARIZE(
                'Table';
                'Table'[Month]
            );
            "sum";
            CALCULATE(
                sum(
                    'Table'[Amount]
                );
                filter(
                    all(
                        'Table'[Month]
                    );
                    'Table'[Month]=earlier(
                        'Table'[Month]
                    )
                )
            )
        )
        ;[sum]
    );
    all('Table')
)

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

View solution in original post

8 REPLIES 8
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

you can't reference a measure in a Min formula. Therefore you have to recalculate you sumamount in your new min-measure using some Summarize and addcolum. Here the solution that should work for you

MinOfSumAmount = calculate(
    minx(
        ADDCOLUMNS(
            SUMMARIZE(
                'Table';
                'Table'[Month]
            );
            "sum";
            CALCULATE(
                sum(
                    'Table'[Amount]
                );
                filter(
                    all(
                        'Table'[Month]
                    );
                    'Table'[Month]=earlier(
                        'Table'[Month]
                    )
                )
            )
        )
        ;[sum]
    );
    all('Table')
)

 

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Anonymous
Not applicable

Thanks Jimmy, this expression works perfectly fine with me.

Hello @Anonymous 

 

your feedback is very appreciated

I'm very glad I could help you

 

All the best

 

Jimmy

Anonymous
Not applicable

Anmerkung 2020-02-03 170151.png

Hi,

 

you have to remove the Date[Month] Context with the ALL Statement and you will get the exact result

 

 

 

 

MinTest = Calculate(MIN([Total Amount]);ALL('Date'[Month]))

 

 

 

 

 
Anonymous
Not applicable

Thanks for the reply.

 

Amount field is calculated measure so i cannot use Min function on it, i have updated your suggested expression and tried  as below one but still it gives 0:

 

Calculate(MINX(VALUES(Date[Month]),[Amount]),ALL('Date'[Month]))
 
Thanks.
 
Anonymous
Not applicable

Thanks, but i have getting below error for the  expression:

MinTest = Calculate(MIN([Total Amount]);ALL('Date'[Month]))

Errror : MIN function only accepts a column reference as the argument number 1

 

 

dax
Community Support
Community Support

Hi @Anonymous , 

You could try to use below measure to see whether it work or not

Measure = MINX(ALL('Date'[Month]),[Total Amount])

 

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

In my formula I also use a measure for the amount value. Please try the formula and with your amount measure

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors