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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ljx0648
Helper I
Helper I

getting a max of a measure and keeping it fix monthly

Hi guys,

 

I have two tables already connected in powerbi (using both "date" column in the table)

ljx0648_0-1677854419807.png

Last date of previous fiscal refers to the last date of the previous fiscal year (New fiscal starts Nov 01 every year)

ljx0648_1-1677854444242.png

I got the result for the asset last date of previous fiscal below using a measure (Last FY Measure)

ljx0648_4-1677854776875.png

My question here will be: I am creating a dashboard using the result and tables above.

 

I am trying to first create a measure to get the MAX of asset prvious year (highlighted max column) then another measure to get the final result of the Percent column. (There will be more than one MAX value when the Date is 30 Nov, 2020 and 30 Nov, 2021 as fiscal year increases)

 

I will have two filters: Date and Customer. For the final product, if I pick the filter 30 Nov, 2019 (Date) and A (Customer) the result I would like to get is 3 divded by 11. 

 

Any tips would be helpful.

 

Thank you!

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @ljx0648 ,

 

Please try:

 

MAX Of Previous Fiscal = MAXX(FILTER(SUMMARIZE(ALL(Asset),Asset[Date],'Asset'[Customer],"Value",SUM(Asset[Current Asset])),[Date]=MAX('Calendar'[Last Date of previous fiscal])),[Value])

Asset Last Date Of Previous Fiscal = CALCULATE(SUM(Asset[Current Asset]),FILTER(ALL('Calendar'),[Date]=MAX('Calendar'[Last Date of previous fiscal])))

Percent = DIVIDE([Asset Last Date Of Previous Fiscal],[MAX Of Previous Fiscal])

 

Final output:

vjianbolimsft_0-1678069825562.png

Best Regards,

Jianbo Li

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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @ljx0648 ,

 

Please try:

 

MAX Of Previous Fiscal = MAXX(FILTER(SUMMARIZE(ALL(Asset),Asset[Date],'Asset'[Customer],"Value",SUM(Asset[Current Asset])),[Date]=MAX('Calendar'[Last Date of previous fiscal])),[Value])

Asset Last Date Of Previous Fiscal = CALCULATE(SUM(Asset[Current Asset]),FILTER(ALL('Calendar'),[Date]=MAX('Calendar'[Last Date of previous fiscal])))

Percent = DIVIDE([Asset Last Date Of Previous Fiscal],[MAX Of Previous Fiscal])

 

Final output:

vjianbolimsft_0-1678069825562.png

Best Regards,

Jianbo Li

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

Works like a charm! Thank you so much my friend

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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