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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
admin11
Memorable Member
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% .

 

admin11_0-1615534760052.png

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
selimovd
Super User
Super User

Hey @admin11 ,

 

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 🙂 

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @admin11 ,

 

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 🙂 

SamFischer
Frequent Visitor

Hi @admin11

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.