cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pmanu4112
Regular Visitor

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]
    )

View solution in original post

Tanushree_Kapse
Solution Supplier
Solution Supplier

Hi @pmanu4112 ,

 

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!