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
aakgun
Frequent Visitor

Dynamic Formatting Measure numerical values

I need a workaround for my Measure values. I have percentage and decimal values for my meaure. For percentage ones, I need to display it as formatting "25 % " not like 0.25 or anythig like that.

 

The mesaure value change will be according to the MyField,. So, for  BLABLA Percentage % data in my Myfiled, I need display this value as " 25  % "

 

solution should be like:

 

TextMeasure = IF([MyField]="BLABLA Percentage %", < Something value like 25 %>, [AMOUNT])

 

Can I implement any workaround for this requirement ?

DAta Format is not availbale inside the IF block. Also Measure Formatting option can not be applied because all of the value fileds will be displayed as percentage then.

 

do you have any other opinion

 

Thank you

1 ACCEPTED SOLUTION

@aakgun

If your scenario is not as I thought in below case, please be more specific.

Measure = IF(LASTNONBLANK(Table1[MyField],1)="BLABLA Percentage %",AVERAGE(Table1[value])*100&"%",SUM(Table1[value])&"")


Capture.PNG

View solution in original post

5 REPLIES 5
RafalK
Advocate IV
Advocate IV

Hi - you can also do this with dynamic formatting

 

Here is a tutorial:

https://community.powerbi.com/t5/Desktop/Dynamic-formatting-of-measures-tutorial/td-p/1297373?fbclid...

Rafał Kun
aakgun
Frequent Visitor

Hi all,

 

I want to some more clarify about problem.

 

Can we use text data as measure in Data Field of MAtrix objects. I want to display my data with "% " sign as text value, according to the data rows. So it is a kind of conditional display.

 

I see in forums that  there is a custom measure like " text measure" , but I could not implement it in Power BI desktop.

 

Dou you have any workaround or opinion for this issue.

@aakgun

If your scenario is not as I thought in below case, please be more specific.

Measure = IF(LASTNONBLANK(Table1[MyField],1)="BLABLA Percentage %",AVERAGE(Table1[value])*100&"%",SUM(Table1[value])&"")


Capture.PNG

Hi Eric,

 

Thank you for that workaround. I have displayed as I desired. Just I had a small modification for formatting numerical values.

 

I have used following formatting, and now dispay excellent for my PErcentage labelled values..

 

FORMAT(AVERAGE(tableName[VALUEKolon] ) * 100 , "###,###.##") & " %"

 

Thanks so much

Anonymous
Not applicable

@aakgun were you able to dynamically format numbers?

 

I have similar challenge I have KPI columns with some % and some decimals. based on KPI name i have to format KPI_NUM column. Can you please help?

 

Thank you

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.