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

Measure (formatted as Text) won't display in visual - workaround?

Hi there.

 

When building a report, I had a number of values within the dataset that varied - some percentages, some decimals, others whole numbers. The only way that I could manage to get to display them all in a matrix was to use some SWITCH Dax...

 

Formatted Value (Headline) =
VAR Val = SUM ( 'Guardian Master (Unpivoted)'[Value] )
RETURN
SWITCH (
SELECTEDVALUE ( 'Attribute Sort Order 2'[Attribute] ),
"Guardian Score", FORMAT ( Val, "0.0%" ), "Satisfied with Teaching", FORMAT ( Val, "0.0%" ), "Satisfied with Course", FORMAT( Val, "0.0%"), "Continuation", format (Val, "0.0%"), "Expenditure per Student (FTE)", format (Val, "0"), "Career Prospects", format (Val, "0.0%"), "Average Entry Tariff", format(Val,"0"), "Satisfied with Assessment", format (Val, "0.0%" ), "Student:Staff Ratio", format (Val, "0.0"), "Value Added Score", format (Val,"0")
)

 

Now I have found that because the Measure is formatted as Text, I'm unable to drop that Measure into the Value field of any chart.

 

When I try to drop in the original value, then generally incorrect values are output, as these were all decimals. So in the DAX example above,

'Guardian Score' outputs as a decimal, rather than a percentage.

 

What I need to be able to do is hopefully drop in a Measure to a value field that outputs the formats in the DAX above - can anyone advise a way of amending the DAX to achieve this, or suggest another method that would achieve the same result.

 

Example of how this is displayed in a matrix..

 

PowerBiComm.png

1 REPLY 1
Greg_Deckler
Super User
Super User

@Anonymous Once formatted as Text, you won't be able to use it in a Value field well of many visuals as those need to be numeric or an aggregation of a text column (first, etc.). Perhaps try custom format strings. All the formatting, none of the "change to text": https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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