cancel
Showing results 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.

Helper II

## MINX and MAXX returning higher and lower volume not year

I am trying to get my measures to return the volume of sales for the highest selected year and lowest selected year. I got some measures working but not how I intended. Basically the MAX measure will return the higher value. So if 2021 had higher sales total than 2022 it will return the 2021 sales value. Similarly MIN returns the lower volume not the lower year. Any help is greatly appreciated!!!

EX: If 2023 and 2021 are selected I want the MAXX to return \$7,223,556.01 and MINX to return \$35,559,982.53

 2019 2020 2021 2022 2023 8,337,760.31 9,448,871.42 35,559,982.53 24,448,871.42 7,223,556.01

Invoiced RT ACT Material Cost max per Year =
MAXX(
KEEPFILTERS(VALUES('Raw Order Data'[Invoice Created Date].[Year])),
CALCULATE([Invoiced RT ACT Material Cost])
)

Invoiced RT ACT Material Cost min per Year =
MINX(
KEEPFILTERS(VALUES('Raw Order Data'[Invoice Created Date].[Year])),
CALCULATE([Invoiced RT ACT Material Cost])
)

### @Ashish_Mathur I am hoping you can help as I saw you were able to solve a similar question. I hope I am not being presumptous in tagging you.

1 ACCEPTED SOLUTION
Super User

Hi,

Create a Calendar Table with a calculated column formula for Year.  To your slicer, drag Year from the Calendar Table.  Create a relationship (Many to One and Single) from the Invoice Created Date column to the Date column of the Calendar Table.  Write these measures

Max selected year = max(calendar[year])

Amount at max selected year = calculate([Invoiced RT ACT Material Cost],filter(values(Calendar[year]),Calendar[year]=[Max selected year]))

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
3 REPLIES 3
Super User

Hi,

Create a Calendar Table with a calculated column formula for Year.  To your slicer, drag Year from the Calendar Table.  Create a relationship (Many to One and Single) from the Invoice Created Date column to the Date column of the Calendar Table.  Write these measures

Max selected year = max(calendar[year])

Amount at max selected year = calculate([Invoiced RT ACT Material Cost],filter(values(Calendar[year]),Calendar[year]=[Max selected year]))

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Helper II

Thank you! This is exactly what I needed.

Super User

You are welcome.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors