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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Varela
Frequent Visitor

Card that show the name of worst

Hello community,

 

I learned that you can put names on measure and use them on cards, made a  test and it worked.

 

What I need, and have not being able to do, was create a measure that show the name of the worst agent I have.

 

Sample

 

Agent      Values

Bruno       1

Andre       2

 

I'd need a measure that returns in this case "Bruno"

1 ACCEPTED SOLUTION
Greg_Davurse
Helper I
Helper I

This is what I did to come up with a solution.

I created a table that has the following:

 

Agent    Sales

Bruno    1

Gina      9

Jim        3

Sara      7

 

I then created the following Measures:

 

Sales Units = SUM(Table1[Sales])

 

MinimumValue = MINX(VALUES(Table1[Agent], [Sales Units])

 

To obtain the Name of the ‘worst’ agent with the lowest Sales I used the DAX function, FIRSTNONBLANK(). The following measure should return the Name of the ‘worst’ agent on a Card.

 

WorstValueName = FIRSTNONBLANK(Table1[Agent],IF([Sales Units] = CALCULATE([MinimumValue],VALUES(Table1[Agent])),1,BLANK()))

 

Note: I don’t believe this takes into account if there is a tie between the ‘worst’ amount of sales for multiple names.

 

I referenced the following link to create this: https://www.powerpivotpro.com/2012/06/top-selling-product-using-firstnonblank/

 

Hope this helps!

 

Greg G.

View solution in original post

2 REPLIES 2
Greg_Davurse
Helper I
Helper I

This is what I did to come up with a solution.

I created a table that has the following:

 

Agent    Sales

Bruno    1

Gina      9

Jim        3

Sara      7

 

I then created the following Measures:

 

Sales Units = SUM(Table1[Sales])

 

MinimumValue = MINX(VALUES(Table1[Agent], [Sales Units])

 

To obtain the Name of the ‘worst’ agent with the lowest Sales I used the DAX function, FIRSTNONBLANK(). The following measure should return the Name of the ‘worst’ agent on a Card.

 

WorstValueName = FIRSTNONBLANK(Table1[Agent],IF([Sales Units] = CALCULATE([MinimumValue],VALUES(Table1[Agent])),1,BLANK()))

 

Note: I don’t believe this takes into account if there is a tie between the ‘worst’ amount of sales for multiple names.

 

I referenced the following link to create this: https://www.powerpivotpro.com/2012/06/top-selling-product-using-firstnonblank/

 

Hope this helps!

 

Greg G.

tringuyenminh92
Memorable Member
Memorable Member

I hope you could describe more about what you have(Sample with 2 columns: Agent and Value) and what action you will do with your report and the expectation result in chart/card? So I could propose solution to solve your problem

Helpful resources

Announcements
Europe Fabric Conference

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.