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
StephenF
Responsive Resident
Responsive Resident

Smart narratives second highest spend in a category?

 

Here is the text to get the top spender, how to get the second highest spender?

 

StephenF_0-1652357336617.png

 

 

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @StephenF ,

 

You could create a measure like

top 2 = 
CONCATENATEX (
FILTER (
ALLSELECTED ( 'Table'[ID]),
RANKX (
ALLSELECTED ( 'Table'[ID]),
CALCULATE ( SUM('Table'[Sales]) ),
,
DESC
) <= 2
),
'Table'[ID],
", ",
RANKX (
ALLSELECTED ( 'Table'[ID] ),
CALCULATE ( SUM('Table'[Sales]) ),
,
DESC
)
)

vstephenmsft_0-1652860412843.png

Then you'll get the dynamic top 2.

vstephenmsft_1-1652860447721.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.

Now, how to get the second highest sale only..

amitchandak
Super User
Super User

@StephenF , I tried a few combinations like 2nd highest, rank 2, Seem like you need to train it to use rank for such a case

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.