cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Memorable Member

## How to compute min GP% ?

Hi All

I have a table display YTD GP% , May i know how to capture the lowest GP% .

https://www.dropbox.com/s/qksque5j8dibqlq/PBT_V2021_363%20How%20to%20compute%20min%20YTD%20GP.pbix?d...

Above link is my PBI sample file :-

Paul Yeo

1 ACCEPTED SOLUTION
Super User

you have to build this table first internally and then get the minim value. Try the following measure:

``````Min GP% =
VAR tempTable =
ADDCOLUMNS ( SUMMARIZE ( SALES, SALES[inv] ), "GP% YTD", [GP% YTD] )
VAR result =
MINX ( tempTable, [GP% YTD] )
RETURN
result``````

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi

Edit: @SamFischer was faster, his solution should work as well 🙂

2 REPLIES 2
Super User

you have to build this table first internally and then get the minim value. Try the following measure:

``````Min GP% =
VAR tempTable =
ADDCOLUMNS ( SUMMARIZE ( SALES, SALES[inv] ), "GP% YTD", [GP% YTD] )
VAR result =
MINX ( tempTable, [GP% YTD] )
RETURN
result``````

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi

Edit: @SamFischer was faster, his solution should work as well 🙂

Frequent Visitor

You'd have to iterate over the [GP% YTD] measure for each invoice, and find the minimum value from that. Try the measure below... (note that you'll want to replace 'Table' with whatever the home table for the inv column is)

Min GP % =
VAR GPbyInvTable =
SUMMARIZE ( VALUES ( 'Table'[inv] ), 'Table'[inv], "GP% YTD", [GP% YTD] )
RETURN
MINX ( GPbyInvTable, [GP% YTD] )

Cheers,
Sam

Blog: ApexInsights.net

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors