Forum Discussion

cdawidow's avatar
cdawidow
Icon for Helper III rankHelper III
5 years ago
Solved

VIRTUAL TABLE MEASURES

Hi guys, I am trying to calculate the sales of my customers who are greater than the 95th percentile of all customers within each segment.  The total is correct, but I want the measure to calculate t...
  • Fowmy's avatar
    5 years ago

    cdawidow 


    You can follow the measure given below, I did it with my sample data and you can adopt it. 

    Cutomers 95 Pcntl = 
    var __p = PERCENTILEX.INC( ALLSELECTED('Customer Table'[customore name]),[Total Sales], .95 ) return
    SUMX(
        FILTER(
            VALUES('Customer Table'[customore name]),
            [Total Sales] >= __p
        ),
        [Total Sales]
    )
    

     



     

  • Fowmy's avatar
    Fowmy
    5 years ago

    cdawidow 

    Please try this:

    Cutomers 95 Pcntl = 
    var __cust = FILTER( ALLSELECTED('Customer Table'[customore name]), [Total Sales] > 0 ) 
    var __p = PERCENTILEX.INC( __cust,[Total Sales], .95 ) return
    SUMX(
        FILTER(
            VALUES('Customer Table'[customore name]),
            [Total Sales] >= __p
        ),
        [Total Sales]
    )