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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Custom text based on average column values

Hello I'm new to Power BI, please excuse any faux pas.

 

Currently I have visuals (card and gauge) that display the average value of a numerical columns. Values in this column are between 0 and 10 and represent responses to questions. There are around 100 question and thus around 100 columns, Q1, Q2, Q3 etc.

 

Instead of displaying the average value for each question, is it possible to display text based on the average value? E.g.

*for average values 0 - 4, "negative" is displayed,

*for average values >4 - 6.5, "neutral" is displayed or

*for average values >6.5 - 10, "positive" is displayed

 

example data might be

Q1Q2Q3Q4Q5Q6
278567
459166
557349

 

Ideally I'd like dashboard cards (or other appropriate visual) to show "negative", "neutral", "positive", "negative", "neutral", "positive" for each of the corresponding questions.

 

Thank you in advance for any advice.

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Anonymous ,

 

That is possible  using DAX but I would transform your raw data into a format that is easier for reporting. Below aer a sample formulas (as a measure). The second one explictily specifies the range

Text = 
VAR __AVG =
    CALCULATE ( AVERAGE ( 'Table'[Value] ) )
RETURN
    SWITCH ( TRUE (), __AVG > 6.5, "positive", __AVG <= 4, "negative", "neutral" )
Text2 = 
VAR __AVG =
    CALCULATE ( AVERAGE ( 'Table'[Value] ) )
RETURN
SWITCH ( TRUE(),
__AVG >=0 && __AVG <=4, "negative",
__AVG >4 && __AVG <=6.5, "neutral",
__AVG >6.5 && __AVG <=10, "positive"
)

danextian_0-1689743381566.png

Please see attaced pbix for details

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Please find attached the solution file.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @Anonymous ,

 

That is possible  using DAX but I would transform your raw data into a format that is easier for reporting. Below aer a sample formulas (as a measure). The second one explictily specifies the range

Text = 
VAR __AVG =
    CALCULATE ( AVERAGE ( 'Table'[Value] ) )
RETURN
    SWITCH ( TRUE (), __AVG > 6.5, "positive", __AVG <= 4, "negative", "neutral" )
Text2 = 
VAR __AVG =
    CALCULATE ( AVERAGE ( 'Table'[Value] ) )
RETURN
SWITCH ( TRUE(),
__AVG >=0 && __AVG <=4, "negative",
__AVG >4 && __AVG <=6.5, "neutral",
__AVG >6.5 && __AVG <=10, "positive"
)

danextian_0-1689743381566.png

Please see attaced pbix for details

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Thank you @danextian This is really helpful. I've been able to create a measure "Q1_text" using DAX based on one of my columns (Q1) with the data as it is.

 

The first part of your response mentions transforming the data into a format that is more useful for reporting. I should have mentioned in my initial post that reponses to these questions come from different types of respondants (different departments) and that I want to be able to filter for each dept in my reporting. Can you see a way that I can transform my table to account for this, or will I need to add a text measure for each column?

 

DeptQ1Q2Q3Q4Q5Q6
sales278567
marketing459166
sales557349

Hi @Anonymous ,

If you follow the same format as your raw data is now, you'll end up creating a measure (that returns a text string) for each question. It will be probably be fine with just a few questions but very tedious and hard to to maintain for so many.  Going back to the transformation I mentioned, there is a sample pbix in my previous response.  The transformation users Power Query's unpivot function. These links will help you understand what I mean:

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Just wanted to say thank you @danextian - the tutorials you linked to, along with your guidance and pbix have solved my question and likely saved me hours of work.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.