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
Anonymous
Not applicable

Return category name based on lowest average

Hello community,

 

I am trying to create an automatically updateable report with text that changes depending on the data.

 

I want to write: "You score the lowest on {this category}"

Therefore i need to first extract the lowest value which is calculated as the average of "Besvarelser[Indekskolonne]", and then get the right value name from the "Spørgeskema[Spørgsmål]".

In the bar chart at the bottom i have created the charts by filtering the chart by each value in "Spørgeskema[Spørgsmål]" and then added the value as "Average of Besvarelser[Indekskolonne]".

Is there anyway to automatically make it say "You score the lowest on Har jeg været glad og i godt humør", as that is the lowest score?

Current code is:

MentalSundhedTekst =
DISTINCTCOUNT(Besvarelser[Respondent ID])
& " har besvaret spørgeskemaet."
& UNICHAR ( 10 )
& IF([Indeksscore]>[OverordnetBenchmark],"Jeres indeksscore ligger over benchmarket med ", "Jeres indeksscore ligger under benchmarket med ")
& FIXED([Indeksscore]-[OverordnetBenchmark],0) & " procentpoint"
& UNICHAR ( 10 )
& "I scorer lavest på" & (CALCULATE(MIN(Besvarelser[Indekskolonne])))



Udklip.PNG

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , we can create a rank on category ascending and if that is 1 we can say lowest in category

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://www.youtube.com/watch?v=DZb_6j6WuZ0

Anonymous
Not applicable

I have succesfully created a rank called "Rangering" however I can't figure out how to get the expression out in text.

CALCULATE(SELECTEDVALUE('Spørgeskema'[Spørgsmål]),([Rangering])) ?


Udklip2.PNG

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.

Top Solution Authors