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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Max amount

Hey guys I am trying to create a Dax measure that will give me the MAX amount by the Max month, I want that measure to dynamic. For example if there is a new month, i need that measure to dynamically change. Here is a example:

Month    Amt

Jan          100

Feb          300

Mar         2000

 

i would like the score card show 2000 (which reflects mar) without anything being select.  

1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

// First of all, you have to
// be able to determine which
// month is the last one. To do
// that you need to number your
// months. Say you've created
// a column called MonthConsecutiveNumber.
// Then, to always get the amount for the
// very last month, you write:

[Last Month Amount] =
    SUMX(
        TOPN(1,
            ALL( T ),
            T[MonthConsecutiveNumber],
            DESC
        ),
        T[Amt]
    )

View solution in original post

2 REPLIES 2
daxer-almighty
Solution Sage
Solution Sage

// First of all, you have to
// be able to determine which
// month is the last one. To do
// that you need to number your
// months. Say you've created
// a column called MonthConsecutiveNumber.
// Then, to always get the amount for the
// very last month, you write:

[Last Month Amount] =
    SUMX(
        TOPN(1,
            ALL( T ),
            T[MonthConsecutiveNumber],
            DESC
        ),
        T[Amt]
    )
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

 

Try this measure:

 

Measure= CALCULATE(SUM(Table[Amt]), FILTER(Table, MAX(Table[Date]))

 

 

Mark this as a solution if I answered your question. Kudos are always appreciated.

Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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