Forum Discussion

lennox25's avatar
lennox25
Icon for Post Patron rankPost Patron
2 years ago
Solved

Help to create % Measure

I have created a % measure as follows :

% of Yellow = divide([No of Yellow],[Count of Category])*100-100 
 
The result is correct when unformatted and left as general- however it is showing a minus value e.g  -99.96. I want it to show 99.96% When I format to % it shows incorrectly as -9995.54%
 
The measures No of Yellow is - 
No of Yellow  = if(ISBLANK(CALCULATE(
DISTINCTCOUNT(table [ID]),
FILTER(Table, Table[Colour] = "Yellow"))),0,CALCULATE(
DISTINCTCOUNT(table [ID]),
FILTER (Table, Table [Colour] = "Yellow")))
 
and Count of Category is
Count of  Category = CALCULATE(COUNT(Table [Category]) +0 )
 
 
Can anyone help?
  • Hey lennox25 ,

     

    if you want to use the format as "percentage" option, do not multiply by 100. If you want to show the result as poisitive consider using the ABS function like so:

    % of Yellow = ABS(divide([No of Yellow],[Count of Category])-1)

    Hopefully, this provides what you are looking for.

    Regards,

    Tom

2 Replies

  • Hey lennox25 ,

     

    if you want to use the format as "percentage" option, do not multiply by 100. If you want to show the result as poisitive consider using the ABS function like so:

    % of Yellow = ABS(divide([No of Yellow],[Count of Category])-1)

    Hopefully, this provides what you are looking for.

    Regards,

    Tom

    • lennox25's avatar
      lennox25
      Icon for Post Patron rankPost Patron

      Kudos to you 🙂 Thank you so much!!