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

show the first row where the measure is minimum

I've a table like

 

OriginatorClient_NameCF_ZKCF_SHCF_GOSCF_EFYOrigination Credit USD
EFYaaa20  40$1073
SHbbb13.3340 20$4451
NSvvv6.6780  $1798
NSccccc6.6780  $1798
ZKxxx6.6780  $899
ZKvgrgtg6.6780  $899

 

I'd like to show the first row where Origination Credit USD is minimum,

The expected results in the table should be 

ZKxxx6.6780  

$899

Is there a way to do it?

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

Hi @jaweher899 ,

 

For the requirement of showing first row, you need to add an index column in Power Query.

vstephenmsft_0-1675848825677.png

Then go back to Power BI Desktop and create the following two measures.

Index of MinUSD =
IF (
    SUM ( 'Table'[Origination Credit USD] )
        = MINX ( ALLSELECTED ( 'Table' ), [Origination Credit USD] ),
    SUM ( 'Table'[Index] )
)
FirstRow =
IF (
    MINX ( ALLSELECTED ( 'Table' ), [Index of MinUSD] ) = SUM ( 'Table'[Index] ),
    1
)

Put the "FirstRow" meausre into the visual-level filters and set up show items when the value is 1.

15.png

 

Best Regards,

Stephen Tao

 

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

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @jaweher899 ,

 

For the requirement of showing first row, you need to add an index column in Power Query.

vstephenmsft_0-1675848825677.png

Then go back to Power BI Desktop and create the following two measures.

Index of MinUSD =
IF (
    SUM ( 'Table'[Origination Credit USD] )
        = MINX ( ALLSELECTED ( 'Table' ), [Origination Credit USD] ),
    SUM ( 'Table'[Index] )
)
FirstRow =
IF (
    MINX ( ALLSELECTED ( 'Table' ), [Index of MinUSD] ) = SUM ( 'Table'[Index] ),
    1
)

Put the "FirstRow" meausre into the visual-level filters and set up show items when the value is 1.

15.png

 

Best Regards,

Stephen Tao

 

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

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.