Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Percentage segmentation ok %column

Hi,   I have query with % in column and I would like to creage segmentation like upper 20% mid 20-80% low 80-20%   this is example of query  where I would like to add another column with the segm...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Anonymous ,

    I created some data:

    Here are the steps you can follow:

    1. Add Column Index Column From 1.

    2. Create calculated column.

    %per =
    CALCULATE(SUM('Table'[% column]),FILTER(ALL('Table'),'Table'[Index]<=EARLIER('Table'[Index])))
    Segementation =
    var _highestvalue=100
    var _20per=_highestvalue * 0.002
    var _20per80per=_highestvalue * 0.008
    return
    SWITCH(TRUE(),
    'Table'[%per] <=_20per,"UPPER 20%",
    'Table'[%per] >_20per&&'Table'[%per]<=_20per80per,"MIDDLE 80-20%",
    "low 80-20%")

    3. Result:

     

    Best Regards,

    Liu Yang

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