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
scabral
Helper IV
Helper IV

Custom Formatted Measure in Pie Chart

I created the following measure to custom format a value:

 

VAR SkipThousands =        
            IF([TIV] > 0, ROUNDDOWN ( DIVIDE ( LOG10 ( [TIV]), 3 ), 0 ))
VAR ValueFormatString =
        SWITCH (
            SkipThousands,
            0, "$#,0",        -- Integer number
            1, "$#,0,.0K",   -- Thousand
            2, "$#,0,,.0M",  -- Million
            3, "$#,0,,,.0bn", -- Billion
            "$#,0,,,,.0T"    -- Trillion
        )
RETURN
IF([TIV] = 0, "$0",
FORMAT([TIV],ValueFormatString))
 
This measure works fine in a table, but if I try to use it in a Pie Chart, i get the following error:
 
Can't Display Visual
Negative vlaues aren't supported and are being displayed as absolute values.
 
There are no negative numbers in the entire dataset for this measure.  If I use just the underlying [TIV] measure, it works fine.  It doesn't like the formatting for some reason.  Is this a bug?
 
Scott
4 REPLIES 4
Anonymous
Not applicable

Hi @scabral ,

 

Have you tried going into the dataview and check if there are actuall negative values?

My tests did not reproduce your problem,can you provide some sample data or .PBIX files so that I can better help you solve the problem, please pay attention to protect your private data ,thank you.

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Hi Neeko Tang,

 

how to i upload a pbix file to the forum?  I didn't see an option.

Anonymous
Not applicable

Hi @scabral ,

 

Please refer to this link: How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

Best Regards,

Neeko Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

https://app.box.com/s/csahwld2tyuaiq78u1tysero3u9htdce 

 

Hi Neeko Tang,

 

I've uploaded and shared sample file to BOX and attached link.

 

There is just 1 table where I created a TIV measure to just sum up the Total Insured Value.

 

Now, I noticed that if i create the new measure called TIV Formatted with the code i listed above, it saves it as a text field and i cannot change it.  If I use the attached pbix as the dataset and connect to it via another pbix and create the TIV formatted measure there, it allows me to set it to a number.  Not sure why that is.  But you cannot use text field in the values section of a pie chart, so you will have to use the attached pbix as a dataset and create another pbix to create the measure as a number and use it in the pie chart where you will see the error.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

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.