Forum Discussion
Wrong number formatting data label when highlighted
I have a simple graph with a measure "On time" which is formatted as %, normally it looks fine
But if I highlight a category or country or anything it loses its data formatting:
Any idea what I could do to correct this?
It sounds reasonable, but still doesn't work..
Luckily this was not in a Production file, but just connected to a test environment and in the production environment it worked without any workarounds..
14 Replies
- rohit1991Super User
Hii vipett
This happens because when a visual is highlighted, Power BI internally creates a second version of your measure (the “highlighted value”), and that temporary value does not keep the original formatting from the model. Since formatting is lost during highlight, the only fix is to explicitly format the measure using FORMAT() for the data label, like:
OnTime_Display = FORMAT([On time], "0.0%")Use this field only for labels/titles (not calculations). This forces the percent format even when highlighted and resolves the issue.
- vipettHelper III
Thanks, but even when I added that measure and put it in the Data labels tab as values, but I still get the same result
- v-venuppuCommunity Support
Hi vipett ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you GeraldGEmerick ChielFaber rohit1991 for the prompt response.
The percentage formatting disappears during highlighting because Power BI creates an internal “highlighted value” that loses the measure’s formatting metadata in your PBIX.This is why the problem does not happen in a new file.Keep your original numeric measure, but create a display-only wrapper measure for data labels:
On-time % (orders) – Display =
VAR v = [On-time % (orders)]
RETURN FORMAT(v, "0.0%")Then:
Use [On-time % (orders)] for the visual values.
Use On-time % (orders) – Display only in Data labels.
This forces Power BI to show the correct % formatting even when the visual is highlighted.
If formatting still breaks:
Your PBIX has corrupted formatting metadata - recreate the model in a new PBIX (this is why your test file works correctly).
- vipettHelper III
It sounds reasonable, but still doesn't work..
Luckily this was not in a Production file, but just connected to a test environment and in the production environment it worked without any workarounds..
- GeraldGEmerickSuper User
vipett I'm not able to replicate this behavior when I set a column to be "%" formatted in the Formatting section of the Column tools tab in the ribbon. How are you doing your formatting?
- vipettHelper III
THis is how I set it
- GeraldGEmerickSuper User
vipett Which version of Power BI Desktop are you using? I am currently on the November 2025 version.
- ChielFaberSuper User
Could you show us the measures your using?
Try creating a measure with an assigned format:
OnTime % (Formatted) :=
VAR v = [OnTime %]
RETURN FORMAT(v, "0.0%")- vipettHelper IIIOn-time % (orders) =VAR OrdersScope =SUMMARIZE('Purchase Order Line','Purchase Order Line'[DIM_COMPANY_KEY],'Purchase Order Line'[DIM_SITE_KEY],'Purchase Order Line'[Order No])VAR OrdersEval =ADDCOLUMNS(OrdersScope,"__Eligible",CALCULATE(COUNTROWS('Purchase Order Line'),ALLEXCEPT('Purchase Order Line','Purchase Order Line'[DIM_COMPANY_KEY],'Purchase Order Line'[DIM_SITE_KEY],'Purchase Order Line'[Order No]),NOT ISBLANK('Purchase Order Line'[DatediffPromied])),"__Late",CALCULATE(COUNTROWS('Purchase Order Line'),ALLEXCEPT('Purchase Order Line','Purchase Order Line'[DIM_COMPANY_KEY],'Purchase Order Line'[DIM_SITE_KEY],'Purchase Order Line'[Order No]),NOT ISBLANK('Purchase Order Line'[DatediffPromied])&& 'Purchase Order Line'[DatediffPromied] >= 1))VAR TotalEligibleOrders =COUNTROWS( FILTER(OrdersEval, [__Eligible] > 0 ) )VAR OnTimeOrders =COUNTROWS( FILTER(OrdersEval, [__Eligible] > 0 && [__Late] = 0 ) )RETURN IF( TotalEligibleOrders = 0, BLANK(), DIVIDE(OnTimeOrders, TotalEligibleOrders) )