问题
When I create a new measure with formula, i.e. sum(col1)/max(col2), it automatically converts the result into #.#% format. Strangely, it doesn't happen all the time; sometimes it just gives result #.## format.
Any idea of how to format a new measure (not column) to be treated as percentage?
回答1:
In Power BI there is a option in the taskbar when you enter your measure.
In Power Pivot for Excel you can select the format directly in the measure editor (Or editor for calculated fields. The name depends on your version of Excel)
If you want to take over manually you can also use the Format()
formula:
= FORMAT(Sum(Table[Field]),"0.00%")
回答2:
There is another way to convert the value into % in Power BI Desktop.
- Create a measure with simple
Divide
formula - Click on the name of measure in
FIELDS
section - Go to
Modeling
tab and select % sign inFormatting
section
The field will automatically be converted to % value.
来源:https://stackoverflow.com/questions/38353064/how-to-format-new-measure-not-column-in-power-bi-as-percentage